Assignemnt #24 Age In Five Years
Code
///Name: Morgan Kaplan
///Period: 5
///Project Name: AgeInFiveYears
///File Name: AgeInFiveYears.java
import java.util.Scanner;
public class AgeInFiveYears
{
public static void main( String[] args )
{
Scanner momo= new Scanner(System.in);
String name;
int age;
System.out.println( "What's your name squirt?");
name=momo.next();
System.out.println( "Hi, " + name + "! How old are you?" );
age=momo.nextInt();
System.out.println( "In five years you will be " + (age + 5) + " and five years ago you were " + (age - 5) + ".");
}
}
Picture of Output