Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 

Tags
relational logical


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.