Question: Im using c++ and I dont know what Im doing wrong. My programming lab is really sensitive with cout statements and spacings. Define a class
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. Add accessor and mutator functions to read and set both member variables. Add another function that returns the monetary amount as a double. In main(), test the implementation of your class with two different Money objects. Ask the user to enter values for dollars and cents and then display the value as a double | SAMPLE RUN #1:Money- ( Interactive Session Show Invisibles ) MONEY OBJECT 1: Enter the dollar value as an integer:10 Enter the cents value as an integer:25 Money object 1 as a double: $10.25 MONEY OBJECT 2: Enter the dollar value as an integer:111 Enter the cents value as an integer:11 Money object 2 as a double: $111.11
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
