Assignment #23 and More User Input of Data
Code
///Name: Tim Gibson
///Period: 6
///Project Name: More User Input
///File Name: MoreUserInput.java
///Date Finished: 9/23/15
import java.util.Scanner;
public class MoreUserInput
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
String firstName, lastName, login;
int grade, id;
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: " );
id = 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( "\t Login: " + login );
System.out.println( "\t ID: " + id );
System.out.println( "\t Name: " + lastName + ", " + firstName );
System.out.println( "\t GPA: " + gpa );
System.out.println( "\t Grade: " + grade );
}
}
Picture of the output