Wednesday, February 6, 2013

Project 3: Age problem

Create an program that allows the user to input an age in years and then displays one of the following (or similar) responses. You program should be able to figure out how many years to display in some of the responses :


Age Range                    Response
0 < age <6 You are considered a young minor. But, in approximately ___ year(s) you will be able to attend school!
6<= age<16In approximately ___ year(s) you will be able to drive!
16<=age<21In approximately ___ year(s) you will be of legal drinking age.
21<=age<35You are of legal drinking age. In approximately ___ year(s) you will be able to run for president!
35<=age<120You are old enough to run for U.S. President.
age >= 120You are too enough to run for U.S. President.


Tip: the most suitable type of age is "int"
       "if-elseif-else" would be perfect for this program
       

Due: 2/13/13 midnight

No comments:

Post a Comment