Solved

What Do You Need to Add to the Class Definition \quad

Question 3

Essay

What do you need to add to the class definition to overload operator < so that it applies to the type Money from Display 8.1? Given this extract from the class Money from Display 8.1 of the text.
class Money
{
\quad public:
\quad\quad Money( );
\quad\quad // other constructors
\quad\quad // other public members
\quad\quad int getCents( )const;
\quad\quad int getDollars( )const;
\quad private:
\quad\quad int dollars;
\quad\quad int cents;
\quad\quad // other private members
};

Correct Answer:

verifed

Verified

Related Questions