//This is the HEADER FILE money.h This is the INTERFACE for the class Money. //Values of this type are amounts of money in U.S. currency. #ifndef MONEY_H #define MONEY_H #include class Money { public: friend Money operator +(const Money& amount1, const Money& amount2); //Returns the sum of the values of amount 1 and amount2. friend Money operator -(const Money& amount1, const Money& amount2); //Returns amount 1 minus amount2. friend Money operator -(const Money& amount); //Returns the negative of the value of amount. friend int operator ==(const Money& amount1, const Money& amount2); //Returns true if the amount1 and amount2 have the same value; friend int operator < (const Money& amount1, const Money& amount2); //Returns true if amount1 is less than amount2. Money(long dollars, int cents); //Initializes the object so its value represents an amount with //the dollars and cents given by the arguments. If the amount //is negative, then both dollars and cents should be negative. Money(long dollars); //Initializes the object so its value represents $dollars.00. Money( ); //Initializes the object so its value represents $0.00. double get_value( ) const; //Returns the amount of money recorded in the data portion //of the calling object. friend istream& operator >>(istream& ins, Money& amount); //Overloads the >> operator so it can be used to input values of type //Money. Notation for inputting negative amounts is as in -$100.00. //Precondition: If ins is a file input stream, then ins has //already been connected to a file. friend ostream& operator <<(ostream& outs, const Money& amount); //Overloads the << operator so it can be used to output values of type //Money. Precedes each output value of type Money with a dollar sign. //Precondition: If outs is a file output stream, then outs has //already been connected to a file. private: long all_cents; }; #endif //MONEY_H