Assignment # 23 and More User Input
Code
/// Name: Tommy Oyuntseren
/// Period: 7
/// Program Name: MoreUserInput
/// File Name: MoreUserInput.java
/// Date Finished: 10/1/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( );
System.out.println("Students, please enter the following information so i can get a profit.");
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();
if (grade > 9 || grade < 12 ) System.out.println("You got the right grade ");
System.out.print( "Student ID: " );
ID = keyboard.nextInt();
System.out.print( "Login: " );
login = keyboard.next();
System.out.print( "GPA: " );
GPA = keyboard.nextDouble();
System.out.println("Your information:");
System.out.println(" Login: " + login);
System.out.println(" ID: " + ID);
System.out.println(" Name: " + lastName + "," + firstName);
System.out.println(" GPA: " + GPA);
System.out.println(" Grade: " + grade);
}
}
Picture of the output