This contains the main function (Driver Program) which is used to test your class. It will be provided to you. DO NOT modify this main function. |
amount
in cents and not dollars to the removeCoins()
function- they have it. Although I believe it is an unneccesary complication, we can easily adapt.Coins.h – This contains the class definition for the Coins class and each of the classes that are derived from Coins. This file will be provided for you. PiggyBank.h - This contains the class definition for the PiggyBank class. This file will be provided for you. |
protected
class members. It has to be done in a different way - with initializer list. Also, no friend functions or classes.removeCoins()
function is supposed to work in a way that would rather give too much money than to little, as output and description suggest:Remove coins from the PiggyBank getting the least number of coins needed to fulfill the request. The coins are not removed when the total value in the bank is less than the requested amount which is given in cents. Note: you may have to remove more money than the requested amount based on which coins are in the bank. |
while
loops you can see if
s, which are to verify if in any point there is a need to withdraw more than requested.Coins (int = 0, int = 0)
. I believe that the fact that in your first post you put a parameterless constructor in the class is an error.
|
|
|
|