Programming Assignment #21
Code
/// Name: Dylan Sleeper
/// Period: 6
/// Program Name: Inputs
/// File Name: Inputs.java
/// Date Finished: 10/22/2015
import java.util.Scanner;
public class Input{
public static void main(String[] args){
Scanner keyboard = new Scanner(System.in);
String fName, lName, login;
int grade, sID;
double gpa;
System.out.print("First name: ");
fName = keyboard.next();
System.out.print("Last name: ");
lName = keyboard.next();
System.out.print("Grade 9-12: ");
grade = keyboard.nextInt();
System.out.print("Student ID: ");
sID = keyboard.nextInt();
System.out.print("Login: ");
login = keyboard.next();
System.out.print("GPA (0.0-4.0): ");
gpa = keyboard.nextDouble();
System.out.println();
System.out.println("Your Information:");
System.out.println(" Login: " + login);
System.out.println(" ID: " + sID);
System.out.println(" Name: " + lName + ", " + fName);
System.out.println(" GPA: " + gpa);
System.out.println(" Grade: " + grade);
}
}
Outputs