Assignemnt #37 How Old Are You, Specifically
Code
///Name: Morgan Kaplan
///Period: 5
///Project Name: How Old Are You, Specifically
///File Name: HORYS.java
import java.util.Scanner;
public class HORYS
{
public static void main( String[] args )
{
Scanner momo= new Scanner(System.in);
int age;
String name;
System.out.println ( " What is your name? " );
name=momo.next();
System.out.println ( " What is your age " + name + " ? " );
age=momo.nextInt();
if ( age < 16 )
{
System.out.println( "You can't drive " + name + "." );
}
if ( age > 15 && age < 18 )
{
System.out.println( " You can drive but not vote " + name + "." );
}
if ( age < 25 && age > 18 )
{
System.out.println( "You can vote but not rent a car " + name + "." );
}
if ( age > 24 )
{
System.out.println( " You trully free homie " + name + "." );
}
}
}
Picture of Output