Assignment #37 and How Old Are You Specifically
Code
/// Name: Graham Pollock
/// Period: 5
/// Program Name: How Old Are You Specifically
/// File Name: HowOldAreYouSpecifically.java
/// Date Finished: 10/21/2015/
import java.util.Scanner;
public class HowOldAreYouSpecifically
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
int age;
System.out.print(" How Old Are You? ");
age = keyboard.nextInt();
if ( age < 16 )
{
System.out.println("You Can't Drive.");
}
else if ( age >= 16 && age < 18 )
{
System.out.println( "You can drive but not vote." );
}
else if ( age >= 18 && age <= 24 )
{
System.out.println( "You can vote but not rent a car." );
}
else if ( age >= 25 )
{
System.out.println( "You can do pretty much anything." );
}
}
}
Picture of the output