Question: C++ (comment the code) 1. // P81a.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. // P81a.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. // P81a.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 void add (AltMoney m1, AltMoney m2, AltMoney &sum); 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() int d, C; AltMoney mi, m2, sum; 21. { 22 23. 24. 25. 26. 27. 28. 29. sum = AltMoney(0,0); read_money(d, c); mi - AltMoney(d, c); cout = 100) { 68. sum.cents = sum.cents - 100; 69. extra = 1; 70. } 71. sum.dollars = m1.dollars + m2.dollars + extra; 72. } 73. 74. void read_money(int &d, int &c) 75. { 76. cout >d; 78. cout > C; if( d

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!