Question: C++ Help Pls Define a class named Money that stores a monetary amount. The class should have two private integer variables, one to store the
C++ Help Pls
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 of cents. Include a default constructor that initializes the amount to $0.00 and an overloaded parameterized constructor to initialize any non-zero amount.
Add accessor member functions: getDollars( ) getCents( )
Add mutator member functions: setDollars( )setCents( )
Add a condition to your setCents() mutator that will update the dollars member if the cents input argument is 100 or larger.
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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
