Question: C++ Question Program: https://pastebin.com/BdpNAEYK Modify the above program to include the following changes. 1. Modify the previous add function so that it becomes now a
C++ Question
Program:
https://pastebin.com/BdpNAEYK Modify the above program to include the following changes.
1. Modify the previous add function so that it becomes now a member function of the class AltMoney. The function takes the sum of dollars and cents of an object AltMoney and returns the result as an AltMoney. Note that in the above version of the program, the object sum has been passed by reference. Do not pass the sum any longer.
2. Add a new friend function, called subtract, that computes the subtraction of one money from another.
3. Modify read_money and make it member function of AltMoney. Note that if you make read_money a member function, then you can use it to directly initialize the dollars and cents of an AltMoney type object directly.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
