Assignment #22 Name,Age, and Salary
Code
///Name: Ian Grant
///Period:5
///Project Name: Name,Age, and Salary
///File Name:nas.java
///10/13/15
import java.util.Scanner;
public class nas
{
public static void main(String[] args)
{
String name;
int age;
double salary;
Scanner keyboard = new Scanner(System.in);
System.out.println("Hello. Whats your name? ");
name=keyboard.next();
System.out.println("Hi, "+name+"! How old are you? ");
age=keyboard.nextInt();
System.out.println("So you're "+age+", that's really old.");
System.out.println("How much do you make, "+name+"?");
salary=keyboard.nextDouble();
System.out.println(salary+"! I hope that's per hour and not per year!");
}
}
Output