Question: In c++ code please answer Assume you have the following class: class Price private: int dollars; int cents: public: Price) dollars cents 0 Price (int
Assume you have the following class: class Price private: int dollars; int cents: public: Price) dollars cents 0 Price (int d, int c) dollars di cents c) li 1. (30 points) Implement the overloaded - operator for Price to compute the difference of two Price objects, and return the result as a Price object containing the difference. Negative dollars is okay. So that p3 contains 2 dollars and 90 cents Price p1 (6, 30) Price p2 (3, 40) Price p3pl -p2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
