|
You only need to know the amount change the cashier will hand back. I normally would say not to hard code any value like this, but for this example I would say hard code the change.
You would have a value like change=78 (hard coded), and then the input would be how many coins to return. Obviously there is a minimum number of coins they can choose, and a maximum as well. Maximum would be 78 in this case all pennies, and the minimum would be 6 (3 quarters and 3 pennies). Any thing above 78 or below 6 would be and error.
__________________
|