Assignment #23 More User Input
Code
///Name: Ian Grant
///Period:5
///Project Name: More User Input
///File Name:PrivInfo.java
///10/13/15
import java.util.Scanner;
public class PrivInfo
{
public static void main(String[] args)
{
String firstName,lastName,login;
int grade,stuNum;
double gpa;
Scanner keyboard = new Scanner(System.in);
System.out.println("Please enter the following information so I can sell it for a profit!");
System.out.print("First name: ");
firstName=keyboard.next();
System.out.print("Last name: ");
lastName=keyboard.next();
System.out.print("Grade (9-12): ");
grade=keyboard.nextInt();
System.out.print("Student ID: ");
stuNum=keyboard.nextInt();
System.out.print("Login: ");
login=keyboard.next();
System.out.print("GPA(0.0-4.0) ");
gpa=keyboard.nextDouble();
System.out.println("Your information:");
System.out.println("\t Login: "+login);
System.out.println("\t ID: "+stuNum);
System.out.println("\t Name: "+lastName+", "+firstName);
System.out.println("\t GPA: "+gpa);
System.out.println("\t Grade: "+grade);
}
}
Output