Question: In C++ (Visual Studios preferred) Comments and steps please The Assignment: Define a class named Money that stores a monetary amount. The class should have

In C++
(Visual Studios preferred)
Comments and steps please
 In C++ (Visual Studios preferred) Comments and steps please The Assignment:

The Assignment: Define a class named Money that stores a monetary amount. The class should have two private integer variables, one to store the number of dollars and another to store the number ofcents. Include a default constructor that initializes the amount to $0.00 and an overloaded parametrie constructor to initialize any non-zero amount (as demonstrated in the example program below). You must develop your solution with three separate files; money h, money.cpp, and main.cpp Add the following accessor member functions getDollars() * getCents) retums the private int dollars. Should not be able to modify the data rctums the private int cents. Should not be able to modify the data Add the following mutator member functions: addDo1lars() e addCents() adds to the private int dollars. Does not return anything. adds to the private int cents. Does not return anything. Add a condition to your addCents) mutator that will update the dollars member if the cents o For example: a function call to addCents(135) on an object that already has 10 cents in it setcents (235) on the same object would change the cents member to 25, and increass member grows to 100 or larger would set the cents member to 25, and increase the current dollar amount by 1 Add another member function named getAmount() that returns the monetary amount as a single double number Write a main() program that tests all of your member functions with at least two different Money objects. In addition to testing your mutators, your code should be able to print the following output (or similar) using your getDollars() and getcents0, or just the getAmount) member functions as shown in the sample console output below Testing Money Class Money object1 has the amount $20.35 Money object2 has the amount $218.03- printed with just getAmount() printed with both getDo 11ars) and getcents O Submission: Your solution must be completed with separate header (money h), implementation (money.cpp) and application files (main.cpp). Submit in class by the due date on Canvas

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!