If/Else assignment -
03-03-2009, 02: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.
|