Saturday, July 31, 2010

Java code help/advice........?

write a program which asks the user to type in an integer representing his/her age. if the integer is


1.%26gt;40, prints ';You are very old';


2.%26lt;18, prints ';You are very young';


3. Otherwise prints ';You are in the prime of your life';








You may assume that the user will not make any typing errors





Thanks a lot for your helpJava code help/advice........?
So the question I have to ask is do I really want to help you with something that is so easy?





if (inputAge %26gt; 40) {


System.out.println(';You are very old';);


} else {


if (inputAge %26lt; 18) {


System.out.println(';You are very young';);


} else {


System.out.println(';You are in the prime of your life';);


}


}





Have fun.

No comments:

Post a Comment