Assignment #22 and Name Age Salary
Code
/// Name: Graham Pollock
/// Period: 5
/// Program Name: Name Age Salary
/// File Name: NameAgeSalary.java
/// Date Finished: 9/30/2015
import java.util.Scanner;
public class NameAgeSalary
{
public static void main( String[] args )
{
String name;
int age;
double salary;
Scanner keyboard = new Scanner(System.in);
System.out.println( "Hey What's Your Name?" );
name = keyboard.next();
System.out.println( "Hey " + name + " How old are you?");
age = keyboard.nextInt();
System.out.println( age + "? Awesome!.");
System.out.println( name + ", how much do you make?");
salary = keyboard.nextDouble();
System.out.println( "$" + salary + "? That's cool.");
System.out.println( "So your name is " + name + ", you're " + age + " years old, and have a salary of $" + salary );
}
}
Picture of the output