Assignemnt #24 - Age in 5 Years
Code
/// Name: Caelan Dorstad
/// Period: 6
/// Program Name: Age in 5 Years
/// File Name: Agein5Years.java
/// Date Finished: 10/21/2015
import java.util.Scanner;
public class Age{
public static void main(String[] args){
Scanner keyboard = new Scanner(System.in);
String Name;
int Age;
System.out.print("Hello. What is 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 years you will be " + (Age + 5) + " years old?");
System.out.println("And five years ago you were " + (Age-5) + "! Imagine that!!!!!!!!!!!!");
}
}
Picture of the output