View Single Post
Old 11-22-2006, 07:33 AM   #2 (permalink)
toe_cutter
Code Monkey
 
Join Date: Aug 2002
Location: Boston, MA
Posts: 79
toe_cutter is on a distinguished road
Send a message via ICQ to toe_cutter Send a message via AIM to toe_cutter Send a message via Yahoo to toe_cutter
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.
__________________
toe_cutter is offline   Reply With Quote