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{public: Money( ); // other constructors
// other public members int getCents( ) const; int
getDollars( ) const;private:
int dollars;
int cents;
// other private members
};
```What will be an ideal response?

For non-member, non-friend operator overloading. add the following declaration and definition as appropriate file. The syntax here is for a definition outside the class.
```
bool operator < (const Money& amt1,const Money& amt2);
bool operator < (const Money& amt1, const Money& amt2)
{
int dollars1 = amt1.getDollars( );
int dollars2 = amt2.getDollars( );
int cents1 = amt1.getCents( );
int cents2 = amt2.getCents( );
return ((dollars1 < dollars2) ||
((dollars1==dollars2)==;(cents1 < ```

Computer Science & Information Technology

You might also like to view...

The title of each slide and the ________ display in a ScreenTip as you move the scroll box up and down a presentation

A) date B) slide number C) footer D) slide notes

Computer Science & Information Technology

Utility programs are specialized programs that work with the operating system to keep your computer running efficiently

Indicate whether the statement is true or false

Computer Science & Information Technology