Question: using namespace std; Question 2: Define a class named Money that stores US dollars and cents. The class should have two integer data members one

using namespace std;using namespace std; Question 2: Define a class named Money that stores

Question 2: Define a class named Money that stores US dollars and cents. The class should have two integer data members one to store the number of dollars and another to store the number of cents. Implement the following member functions of the class Money, namely, *A constructor with two integer parameters that sets the money object to these two parameters. Default the two parameters to 0 All setters and getters functions *The copy constructor * The function centsMonex ) that converts the dollars data member to cents and add them to the cents data member and returns the result as an integer. centsMoney 0 has the following prototype: int centsMonex O; . addMoney (): add two Money Objects ml and m2 and return the results in a Money object. addMoney. () has the following prototype: Money addMoney (const Money & ml, const Money & m2); * printMonex (): prints out the data members of the Money object. printMonex () has the following prototype: xoid printMonex ) Write a main program to test the above functions and the Money class

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!