Question
C++ programming Assume you have a Money class that has two private attributes: unsigned int cent_; unsigned int dollars_; And the following public methods: Money(unsigned
C++ programming
Assume you have a Money class that has two private attributes:
unsigned int cent_;
unsigned int dollars_;
And the following public methods:
Money(unsigned int cents = 0, unsigned int dollars = 0);
unsigned int getCents() const;
unsigned int getDollars() const;
Overload the following operators. You can decide whether you want the operators to be functions or methods. You may NOT create new methods (other than the operator methods, if you choose to do it that way).
Just copy your functions into this word document, convert it to PDF, and upload it.
Operators to overload (3pts each):
== (assume both operands are Money objects)
+ (assume both operands are Money objects)
<<
> (assume both operands are Money objects)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started