Assignment #23 and More User input
Code
///Name: Trent Lane
///Period: 6
///Program Name: More User Input of Data
///Date Finished: 9/30/15
import java.util.Scanner;
public class MoreUserInput
{
public static void main( String[] args )
{
String name1, name2, login;
int gpa, number, grade;
Scanner keyboard = new Scanner(System.in);
System.out.println( "Please enter the following information so I can sell it for a profit." );
System.out.print( "First name: " );
name1 = keyboard.next();
System.out.print( "Last name: " );
name2 = keyboard.next();
System.out.print( "Grade (9-12): " );
grade = keyboard.nextInt();
System.out.print( "Student ID: " );
number = keyboard.nextInt();
System.out.print( "Login: " );
login = keyboard.next();
System.out.print( "GPA (0.0-4.0): " );
gpa = keyboard.nextInt();
System.out.println( "Your information:" );
System.out.println( " Login: " + login + " " );
System.out.println( " ID: " + number + " " );
System.out.println( " Name: " + name1 + ", " + name2 + " " );
System.out.println( " GPA: " + gpa + " " );
System.out.println( " Grade: " + grade + " " );
}
}
Picture of the output