Assignment #24 Age in 5 years
Code
///Name: Ian Grant
///Period:5
///Project Name: Age in 5 years
///File Name:age5.java
///10/14/15
import java.util.Scanner;
public class age5
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
String name;
int age;
System.out.print("Hello. What's your name? ");
name=keyboard.next();
System.out.print("Hi, "+name+"! How old are you? ");
age=keyboard.nextInt();
System.out.println("Did you know that in five you will be "+(age+5)+" years old?");
System.out.println("And five years ago you were"+(age-5)+"! Imagine that!");
}
}
Output