Assignemnt #23: More User Input
Code
/// Name: Kelsey Lieberman
/// Period 5
/// Program Name: MoreUserInput
/// File Name: MoreUserInput.java
/// Date Finished: 10/1/2015
import java.util.Scanner;
public class MoreUserInput
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
String firstName, lastName, loginName;
int grade, studentId;
double gpa;
///user input///
System.out.println("Please enter the following information for processing:\n");
System.out.print("First Name: ");
firstName = keyboard.next();
System.out.print("Last Name: ");
lastName = keyboard.next();
System.out.print("School Grade (k-12): ");
grade = keyboard.nextInt();
System.out.print("Student ID Number: ");
studentId = keyboard.nextInt();
System.out.print("Login Name: ");
loginName = keyboard.next();
System.out.print("Academic GPA (Unweighted 9-12): ");
gpa = keyboard.nextDouble();
///program response///
System.out.println("The following information is being processed:\n\nName: " + lastName + "," + firstName + "\nID: " + studentId + "\nLogin: " + loginName + "\nGrade: " + grade + "\nGPA: " + gpa);
}
}
Picture of the output