Question: Write a code in C++ ! The output should be the same and Total of two money also. class Money { public: Money(); Money(int dollars,

Write a code in C++ !
Write a code in C++ ! The output should be the same
and Total of two money also. class Money \{ public: Money(); Money(int The output should be the same and Total of two money also.

class Money \{ public: Money(); Money(int dollars, int cents); void setDollars(int); void setCents(int); int getDollars (); int getCents(); friend Money add(Money amount1, Money amount 2); friend bool equal(Money amount1, Money amount 2); double get_value(); // if 12 dollars and 40 cents, this return $12.40 private: int dollars; 3; cents; Enter the amount of your money: 10023 Enter the amount of my money: 10023 Your amount is $100.23. My amount is \$100. 23 . Te have the same amounts. Total amount is : 200.46 Enter the amount of your money: 12580 Enter the amount of my money: 13055 Your amount is $125.80. My amount is $130.55. One of us is richer. Total amount is : 256.35

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!