Solved

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

Question 28

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

For non-member,non-friend operator overl...

View Answer

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents