Ask your own question, for FREE!
Computer Science 96 Online
OpenStudy (anonymous):

write a short program to find the oldest person between you and one other individual. Use a flow control statement to print the outcome of the result.

OpenStudy (anonymous):

What language do you need to use? The simplest way to do this is with an if-else statement if( /*<condition>*/ ) { //print .... } else { //print .... }

OpenStudy (anonymous):

I believe that it is supposed to be switch.

OpenStudy (anonymous):

http://en.wikipedia.org/wiki/Control_flow -- All of the general flow control statements for most programming languages. A switch is not viable since you have two values Age1 and Age2, there's you wouldn't be able to compare both of those inside a switch, unless your programming language lets you do an evaluation inside a switch, though I don't think it's possible. Switches are for specific values on a single variable, let's say you expect age to be between 1-100 switch(Age1){ case 1: case 2: case 3: System.out.println("Toddler"); break; case 4: .... case 12: System.out.println("Kid"); break; case 13: ... case 18: System.out.println("Adolescent"); break; ...etc } Flow control for comparisons between two variables will usually be if-else

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
blitzo5000: i made something
5 minutes ago 9 Replies 2 Medals
mayathegamergrl: whats something that is a waste of time to get for a gaming room/setup?
23 minutes ago 42 Replies 1 Medal
ganster100: today m bday im 17 yayy
41 minutes ago 17 Replies 0 Medals
ganster100: today is my bday yayyy im 17
3 hours ago 0 Replies 0 Medals
jodyross: The narrator asks, "Do i dare eat
7 hours ago 2 Replies 1 Medal
Lazorwolf64: Can someone help me with math?
13 hours ago 6 Replies 1 Medal
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!