Question: Create a Money class and a Hotdog class with the following requirements that are attached in C++. Also, create a non member function, void printRundown(const
Money Class Requirements Negative amounts of Money shall be stored by making both the dollars and cents negative The Money class shall have four (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 even dollar amount A constructor that takes one double, and can assign dollars and cents accordingly . int getPennies) const - Returns the equivalent amount of money as a number of pennies bool isNegative() const void add(const Money 8m) void subtract(const Money 6m) bool isEqual (const Money 8m) const - 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 S: and always show two decimal places - Negative amounts of Money shall be represented in the following manner: ($X.Xx) The Money class shall have two private data members -An integer that represents how many dollars you have. An integer that represents how many cents you have
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
