Assignemnt #24 and Age in Five Years
Code
/// Name: Kyle Ivy
/// Period: 5
/// Program Name: AgeinFiveYears
/// File Name: AgeinFiveYears.java
/// Date Finished: 10/6/2015
import java.util.Scanner;
public class AgeinFiveYears {
public static void main( String[]args ) {
Scanner keyboard = new Scanner(System.in);
int Age , ageinFive , ageFiveAgo;
String name;
System.out.print( "Hello. What is your name? " );
name = keyboard.next();
System.out.println();
System.out.print( "Hi, " + name + "! How old are you? " );
Age = keyboard.nextInt();
ageinFive = Age + 5;
ageFiveAgo = ageinFive - 10;
System.out.println();
System.out.println( "Did you know that in five years you will be " + ageinFive + "?" );
System.out.println( "And five years ago you were " + ageFiveAgo + "! Imagine that!" );
}
}
prog24.PNG