Assignemnt #23 User Input
Code
/// Name: Brendan Miller
/// Period: 5
/// Program Name: User Input
/// File Name: UserInput.java
/// Date Finished: 10/4/2015
import java.util.Scanner;
public class UserInput
{
public static void main( String[] args )
{
String Firstname, Lastname, Grade, Studentid, Login, GPA;
Scanner keyboard = new Scanner(System.in);
System.out.println( "Please enter the following information so I can sell it for profit." );
System.out.print( "First name: ");Firstname = keyboard.next();
System.out.print( "Last name: ");Lastname = keyboard.next();
System.out.println( "Grade (9-12): ");Grade = keyboard.next();
System.out.println( "Student ID: ");Studentid = keyboard.next();
System.out.println( "Login: ");Login = keyboard.next();
System.out.println( "GPA (0.0-4.0): ");GPA = keyboard.next();
System.out.println( "-----------------------------" );
System.out.println( "Your information:" );
System.out.println( " Login: " + Login );
System.out.println( " ID: " + Studentid );
System.out.println( " Name: " + Lastname + ", " + Firstname );
System.out.println( " GPA: " + GPA );
System.out.println( " Grade: " + Grade );
}
}
Picture of the output