Assignemnt #33 How Old Are You, Specifically?
Code
///Name: JJ Deng
///Period: 6
///Program Name: How Old Are You, Specifically?
///File Name: HORUS.java
///Date Finished: 10/20/15
import java.util.Scanner;
public class HORUS
{
public static void main( String[] args )
{
Scanner JJ = new Scanner(System.in);
String name;
int age;
System.out.println("Hey, What is your name?");
name = JJ.next();
System.out.println("Ok "+name+", how old are you?");
age = JJ.nextInt();
if ( age < 16 )
{
System.out.println("You Can't drive "+name);
}
else if ( age == 17 )
{
System.out.println("You can drive but you can't vote "+name);
}
else if ( age == 19 )
{
System.out.println("You can vote but not rent a car "+name);
}
else if ( age > 25 )
{
System.out.println("You can pretty much do anything "+name);
}
}
}
Picture of the output