View Single Post
Create a change-counting game
Old
exographicskip
Junior Member
 
Status: Offline
Posts: 3
Join Date: Mar 2014
Default Create a change-counting game - 03-03-2014, 07:33 PM

How do I get the user to enter arbitrary combinations of coins that will be recognized as a dollar?

I am attempting to have a character ask the user to enter a number of pennies, nickels, dimes, and quarters. If the total value of the coins entered equals a dollar, the character congratulates the user. Otherwise, the character tells the user whether the amount entered was more or less than one dollar (see: Starting Out with Alice, 3/E Exercise 4).

I have created variables for the dollar and coins, one variable per each (e.g., dollar = 1, quarter = 0.25). There is an If/Else statement with the true/false actions.

My handiwork:


EDIT: If anyone can tell me how to crop the image on the forum, I will gladly do so!
Attached Files
File Type: a2w Money 2.5.a2w (227.6 KB, 0 views)

Last edited by exographicskip; 03-03-2014 at 07:34 PM. Reason: Ugly looking formatting (lackthereof) for the image.
   
Reply With Quote