Question: Create this c++ program. Create to classes and name their type Account and Money. Follow the instruction listed below. Please read and implement instructions very
Money Class Requirements - Negative amounts of Money shall be stored by making both the dollars and cents negative The Money class shall have 4 constructors * A default constructor that initializes your Money object to $0.00 A constructor that takes two integers, the first for the dollars and the second for the cents A constructor that takes one integer, for an clean dollar amount A constructor that takes one double, and can assign dollars and cents accordingly - int getPennies const - bool isNegative) const - void add (const Money &m) - void subtract (const Money &m) - bool isEqual (const Money &m) const Returns the equivalent amount of money as a number of pennies *Returns true if your amount of money is negative The sum shall be stored in the calling object The difference shall be stored in the calling object -void print const * This function prints the amount of Money you have, it must print a $,' and always show two decimal places *Negative amounts of Money shall be represented in the following manner: (SX.XX) The Money class shall have two private data members
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
