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
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