Quote:
Originally Posted by jkidd
Hi chickentree -
I did everything that you suggested, as you can tell from this screenshot: https://image.ibb.co/nMUhzo/ifelse_2.jpg
If I enter a number under 21, the bouncer responds accordingly. If I enter the number 21 or a number over 21, the bouncer says "welcome to our exclusive club". If the user types in a number over 21, the bouncer is supposed to say that the user is too old.
I'm not sure what I'm doing wrong.
|
You are still not saving the user input in the age variable. This needs to be done before the if statement, please look at my example code again.
As it is now the user input is tested to see if it is less than 21, after that the user answer is thrown away and the value of Age ( which is now 0) is used in the enclosed if statement so it will never be more than 21.
Mark