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
};
```
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
```
You might also like to view...
________ returns the forecasted values for a specific future target date using exponential smoothing
Fill in the blank(s) with correct word
Forms allow you to customize the way Access displays records by ____.
A. selecting particular fields B. specifying the field order C. adding description field labels D. all of the above