Question: C++ (comment the code) 1. // P82.cpp - This program adds money of two different people 2. #include 3. #include 4. using namespace std; 5.

C++ (comment the code)

C++ (comment the code) 1. // P82.cpp - This program adds money

of two different people 2. #include 3. #include 4. using namespace std;

5. 6. class AltMoney 7. { 8. public: 9. AltMoney(); 10. AltMoney(int

1. // P82.cpp - This program adds money of two different people 2. #include 3. #include 4. using namespace std; 5. 6. class AltMoney 7. { 8. public: 9. AltMoney(); 10. AltMoney(int d, int c); 11. friend AltMoney add(AltMoney m1, AltMoney m2); 12. void display_money(); 13. private: 14. int dollars; 15. int cents; 16. }; 17. 18. void read_money(int &d, int &c); 19. 20. int main() 21. { 22. int d, c; 23. AltMoney mi, m2, sum; 24. 25. sum = AltMoney(0,0); 26. 27. read_money(d, c); 28. mi - AltMoney(d, c); 29. cout = 100) { temp.cents - temp.cents - 100; extra = 1; 71. } temp.dollars = m1.dollars + m2.dollars + extra; 74. return temp; 75.) 76. 77. void read_money(int& d, int& c) 78. { 79. cout > d; 81. cout > C; 83. if (d ). Overload the smaller than sign (9. Overload the equality sign (2-). So that comparisons can be made between AltMoney objects to determine who is greater, lesser, or equal. Include in the main a small demonstration of the operators' use

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!