Exercise : WazzuAdmit

Write a complete program WazzuAdmit with the behavior shown below. Use the Scanner to read user input for a student's grade point average and SAT exam score. A GPA of 1.8 or an SAT score of 900 or above (or both) will cause the student to be accepted; anything less will cause him/her to be rejected.

Washington State University admission program
What is your GPA? 3.2
What is your SAT score? 1280
You were accepted!

Exercise - answer

import java.util.*;   // for Scanner

public class WazzuAdmit {
    public static void main(String[] args) {
        Scanner console = new Scanner(System.in);
        System.out.println("Washington State University admission program");
        
        System.out.print("What is your GPA? ");
        double gpa = console.nextDouble();
        System.out.print("What is your SAT score? ");
        int sat = console.nextInt();
        
        if (gpa >= 1.8 || sat >= 900) {
            System.out.println("You were accepted!");
        } else {
            System.out.println("You were rejected!");
        }
    }
}