Assignemnt #22 NameAgeAndSalary
Code
///Name: Morgan Kaplan
///Period: 5
///Project Name: NameAgeAndSalary
///File Name: NameAgeAndSalary.java
import java.util.Scanner;
public class NameAgeAndSalary
{
public static void main( String[] args )
{
String name;
int age;
double wage;
Scanner momo= new Scanner(System.in);
System.out.print( "What is your name?" );
name= momo.next();
System.out.print( " Hi, " + name + " How old are you? ");
age= momo.nextInt();
System.out.println( "So you're " + age + ", eh? Thats not old at all." );
System.out.println( "How much do you make, " + name + "?" );
wage= momo.nextDouble();
System.out.println( "" + wage + "! I hope thats per hour and not per year! LOL! " );
}
}
Picture of Output