Alice Community  

Go Back   Alice Community > General Discussion > The Lounge

Reply
 
Thread Tools Display Modes
If/Else assignment
Old
bsmill04
Guest
 
Status:
Posts: n/a
Default If/Else assignment - 03-03-2009, 03:49 PM

This assignment had me make a bar scene with 2 people. The first person walks in and heads to the bar. The bartender asks the age of the girl. If the girl enters 21 then the bartender says welcome to the exclusive bar. If the user enters 22 or higher then the bartender says she is too old to drink. If the user enters 20 or lower the bartender says she is too young to drink.

I used 1 if/else statement for the 21 portion. I added another if/else statement into the else portion of the first if/else to run the 22 or higher or 20 or lower part of the assignment. It was really quite simple once I realized i could add if/else statements together.
   
Reply With Quote
Old
Bisdok
Guest
 
Status:
Posts: n/a
Default 03-18-2009, 12:23 AM

Thanks. That will probably help me with a problem I am having.
   
Reply With Quote
Reply

Thread Tools
Display Modes

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 ©2017, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.