Assignemnt #22 Name, Age, and Salary
Code
///Name: Prooz Fereydouni
///Period: 7
///Project Name: Name, Age, and Salary
///File Name: NAaS.java
///Date: 9/23/2015
import java.util.Scanner;
public class NAaS
{
public static void main( String[] args )
{
String name;
int age;
double salary;
Scanner keyboard = new Scanner(System.in);
System.out.println( "Hello, What is your name?" );
name = keyboard.next();
System.out.println( "Hi " + name + ", how old are you?" );
age = keyboard.nextInt();
System.out.println( "Ok " + name + ", I understand that you are " + age + " years old, what is your salary?" );
salary = keyboard.nextDouble();
System.out.println( "Nice job " + name + ", " + salary + " is a pretty good salary (I hope)." );
}
}
Picture of the output