else statements, make a program which displays
a different message depending on the age given.
|less than 16|
|16 to 17|
|18 to 24|
|25 or older|
Note that unlike the original "How Old Are You" assignment, this program must only display exactly one message for a given age and not multiple messages.
Hey, what's your name? (Sorry, I keep forgetting.) Billy_Corgan Ok, Billy_Corgan, how old are you? 17 You can drive but you can't vote, Billy_Corgan.
Hey, what's your name? (Sorry, I keep forgetting.) Billy_Corgan Ok, Billy_Corgan, how old are you? 14 You can't drive, Billy_Corgan.
You can make up your own messages if you want, but you must have
at least four messages, and you must use
statements to make sure only one of the messages is printed for any
©2013 Graham Mitchell
This assignment is licensed under a
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.