/** ************************************************************************* * @brief Exercise 5 - class money * @file money.h * @author * @date Fall 2023 * * @remarks This file contains ****************************************************************************/ #ifndef MONEY_H #define MONEY_H #include #include using namespace std; extern const unsigned numDenominations; extern unsigned values []; class money { public: // Constructors money (); money (const money & M); money (int D, int C); money (const string & S); money (double Amount); // Destructor ~money (); // Operators // Assignment money & operator = (const money & M); // Extraction (input) friend istream & operator >> (istream & input, money & M); // Insertion (output) friend ostream & operator << (ostream & output, const money & M); // Arithmetic operators money operator + (const money & M) const; money operator += (const money & M); money operator - (const money & M) const; money operator -= (const money & M); money operator * (const double & Factor) const; friend money operator * (const double & Factor, const money & M); money operator *= (const double & Factor); money operator / (const double & Divisor) const; money operator /= (const double & Divisor); money operator % (const int & Divisor) const; money operator %= (const int & Divisor); money operator ++ (); // Pre increment money operator ++ (int); // Post increment money operator -- (); // Pre decrement money operator -- (int); // Post decrement // Logical operators bool operator == (const money & M) const; bool operator != (const money & M) const; bool operator < (const money & M) const; bool operator <= (const money & M) const; bool operator > (const money & M) const; bool operator >= (const money & M) const; // Accessors and Mutators int getDollars () const; int getCents () const; vector getCurrency () const; void setCurrency (vector & C); public: // Add attributes and private methods here. unsigned size; // required unsigned * currency; // required }; #endif