Assignment 24, Age in 5 years
Code
///Name: Stella Koliavas
///Period: 5
///Program Name: Age in 5 years
///File Name: Agein5Yrs.java
///Date Finshed: 10/2/15
import java.util.Scanner;
public class AgeIn5Yrs
{
public static void main (String[] args)
{
String Name;
int Age;
Scanner siri = new Scanner(System.in);
System.out.print(" Hi, what's your name?");
Name = siri.next();
System.out.print("Hi, " +Name+ "! How old are you?");
Age = siri.nextInt();
System.out.print("In five years you will be " +(Age+5)+ " years old? And five years ago you were " +(Age-5)+ "!Crazy");
}
}
Picture of the output