/* This is the specification of Money It has been separated from the body of the module - see money.body.cc */ #ifndef __Money__ //The above stops this declaration being included more than once at a time #define __Money__ class Money{ public: //Defines what you can do with Money in a C++ program //Constructors Money(); Money(const int n); Money(const int d0, int c0); Money(const double n); //Output friend ostream& operator<<(ostream& s, Money n); //Arithmetic Money operator+(Money b); Money operator*(int b); Money operator-(); Money operator-(Money b); //Comparisons friend int operator<(Money a, Money b); friend int operator>(Money a, Money b); friend int operator>=(Money a, Money b); friend int operator<=(Money a, Money b); friend int operator==(Money a, Money b); friend int operator!=(Money a, Money b); //Extraction - controlled access to the parts int dollars(); int cents(); private: //needed to set up storage etc... long int d; short int c; }; // end class Money #endif