if statements with compound conditions
&&), make a program that displays a single
message depending on the age given.
|less than 16|
|16 to 17|
|18 to 24|
|25 or older|
This output of this assignment is identical to the "How
Old Are You, Specifically" assignment. However, this time you must
accomplish it using
if statements with compound conditions and you
must not use
else if or
Your name: Dukes Your age: 19 You can vote but you can't rent a car, Dukes.
Your name: Dukes Your age: 12 You can't drive, Dukes.
You can make up your own messages if you want, but you must have at
least four messages, and you must use
to make sure only one of the messages is printed for any given age.
©2013 Graham Mitchell
This assignment is licensed under a
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.