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
};
Correct Answer:
Verified
View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Q21: Given the class definition:
class A
{
public:
//constructors
// other members
private:
int
Q22: Why have we not needed to overload
Q23: Which operators cannot be overloaded?
Q24: If I need to build an object
Q25: Show how to overload the operators
Q26: Which operators can be overloaded only as
Q27: Explain the similarities and differences between (binary)operators
Q29: What are some reasons for using friend
Q30: What objections to the use of friend
Q31: Consider the class definition:
class IntPair
{
int first;
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents