Practice-It! logo

BJP3 Exercise 3.22: CollegeAdmit

Added by: Marty Stepp on 2013/04/01
Keywords: Scanner

(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.

You must log in before you can solve this problem.

user
Log In


indent Re-indent

If you do not understand how to solve a problem or why your solution code doesn't work, please contact your TA or instructor.

If something seems wrong with the Practice-It system itself (errors, slow performance, incorrect problem descriptions/tests, etc.), please contact us.

Is there a problem?
Contact a Practice-It administrator.