Assignment #23 and UserInputData
Code
/// Name: Jason Kim
/// Period: 7
/// Program Name: UserInputData
/// File Name: UserInputData.java
/// Date Finished:9/24/15
import java.util.Scanner;
public class UserInputData
{
public static void main ( String[] args)
{
Scanner keyboard = new Scanner(System.in);
String firstName, lastName, loginName;
int grade, student_id_number;
double GPA;
System.out.println("Please enter the following information so I can sell it for a profit!");
System.out.println();
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: ");
student_id_number = keyboard.nextInt();
System.out.print("Login: ");
loginName = keyboard.next();
System.out.print("GPA (0.0-4.0): ");
GPA = keyboard.nextDouble();
System.out.println();
System.out.println("Your information:");
System.out.println("\t Login: " + loginName);
System.out.println("\t ID: " + student_id_number);
System.out.println("\t Name: " + lastName + ", " + firstName);
System.out.println("\t GPA: " + GPA);
System.out.println("\t Grade: " + grade);
}
}
Picture of the output