#include <iostream> <?xml:namespace prefix = o ns = \"urn:schemas-microsoft-com:
ID: 3655521 • Letter: #
Question
#include <iostream> <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?>
#include <string>
using namespace std;
class counter {
friend ostream &operator<<(std::ostream &, const counter &);
friend istream &operator>>(istream & in, counter &c) ;
private:
char * digits;
int arraySize;
int numDigits;
void addDigit(char digit, int position, char & carry);
static char toDigit(char c);
int convert(int n , int startPosition);
static int sizeOf(int n);
public:
static const int sizeIncrement = 2;
static const counter ZERO, ONE, TWO, MAXINT;
counter (int value = 0);
counter (string s);
counter (const counter & c);
~counter ();
void counter::reset()
void counter::resize(int newSize);
counter & setValue(int n) ;
counter & setValue(const string & s);
void print(ostream & out, bool moreInfo = false) const;
int getArraySize() const;
int getNumDigits() const;
bool isZero() const ;
counter & operator=(const counter & c);
counter & operator=(int n);
int compare(const counter & c) const;
int toInt() const ;
counter& operator++() ;
counter operator++(int n) ;
bool operator> (const counter & c) const
bool operator< (const counter & c) const
bool operator>= (const counter & c) const
bool operator<= (const counter & c) const
bool operator== (const counter & c) const
bool operator!= (const counter & c) const
counter& operator--() ;
counter operator--(int n) ;
counter& operator+=(const counter & c) ;
counter operator+(const counter & c);
counter& operator-=(const counter & c) ;
counter operator-(const counter & c) ;
counter& operator*=(const counter & c) ;
counter operator*(const counter & c) ;
counter & mod(const counter & c, counter & div);
counter & operator/=(const counter & c);
counter operator/(const counter & c);
counter & operator%=(const counter & c);
counter operator%(const counter & c);
};
Explanation / Answer
Traugott can answer this!
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.