Assignment #46 and Age Message 3
Code
///Name: Trent Lane
///Period: 6
///Project Name: Age Messages 3
///Date: 11/11/2015
import java.util.Scanner;
public class AgeMessagesThree
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
String name;
int age;
System.out.print("age : ");
age = keyboard.nextInt();
if ( age < 16 )
{
System.out.println("You cant drive.");
}
if ( 15 < age && age < 18 )
{
System.out.println("You can drive but not vote.");
}
if ( 17 < age && age < 25 )
{
System.out.println("You can vote but not rent a car.");
}
if ( 25 <= age )
{
System.out.println("You can do pretty much anything.");
}
}
}
Picture of the output