logo Practice-It logo

BJP3 Exercise 3.22: CollegeAdmit

Language/Type: Java input method basics parameters Scanner
Author: Marty Stepp (on 2013/04/01)

(NOTE: This problem probably should have been put into Chapter 4 because its solution uses if/else statements, which are not taught until Ch. 4. We are leaving it here in Practice-It to be consistent with the textbook, but the problem will probably be moved in a future edition of the book.)

Write a complete program in a class named CollegeAdmit that uses a Scanner to read user input for a student's grade point average and SAT exam score, and uses these values to decide whether the student is admitted to the university. A GPA below 1.8 will cause the student to be rejected; an SAT score below 900 will also cause a rejection. Otherwise the student is accepted. If both the GPA and the SAT score are too low, print the message about the GPA being too low. Your output should match the following examples:

University admission program
What is your GPA? 3.2
What is your SAT score? 1280
You were accepted!
University admission program
What is your GPA? 3.95
What is your SAT score? 860
Your SAT score is too low.
University admission program
What is your GPA? 1.4
What is your SAT score? 1590
Your GPA is too low.
Type your solution here:

This problem asks for a complete program. Write a complete Java program as a class with a main method. (You do not need to write any import statements.)

You must log in before you can solve this problem.

Log In

If you do not understand how to solve a problem or why your solution doesn't work, please contact your TA or instructor.
If something seems wrong with the site (errors, slow performance, incorrect problems/tests, etc.), please

Is there a problem? Contact a site administrator.