You are a programming intern at the student transfer counselor's office. Having heard you are taking CS
Question:
You are a programming intern at the student transfer counselor's office. Having heard you are taking CS 55, your boss has come to ask for your help with a task. Students often come to ask her whether their GPA is good enough to transfer to some college to study some major and she has to look up the GPA requirements for a school and its majors in a spreadsheet to answer their question. She would like you to write a program that students can use themselves to get their answer. She is providing you with the spreadsheet data.
CS Econ English
UCLA 3.7 3.5 3.2
UCB 3.8 3.4 3.3
UCI 3.6 3.7 3.4
UCSD 3.5 3.3 3.0
You will write a program, TransferAdvisor.java, which asks the user for the school name, the major, and their GPA, and informs them whether their GPA is adequate for the school and major selected, or by how much they need to improve it. If a school or major is not in the spreadsheet, the user is informed. The school names and majors can be entered both as shown in the spreadsheet or in all lowercase letters. The “You need to improve your GPA by ### ...” message should have 2 decimals precision for the GPA regardless of the student GPA entered.
Below are a few runs of the program:
Enter the school name: UCLA
Enter the major: CS
Enter your GPA: 3.457
You need to improve your GPA by 0.24 to transfer to UCLA to study CS
Enter the school name: ucsd
Enter the major: english
Enter your GPA: 3.12
You could transfer to ucsd to study english
Enter the school name: harvard
Enter the major: CS
Enter your GPA: 3.1
harvard is not in the school system
Enter
Enter
Enter
There
The school name: ucla
The major: astrology
your GPA: 2.6 is no astrology major at ucla
Hints:
To avoid a lot of duplication with the code dealing with the GPA comparison and print outs, write a method that takes in the school name, the major name, the required GPA for that major in that school and the student GPA, and prints out either the “You could transfer ...” or the “You need to improve your GPA by ...”.
Avoid if/else if/... to match the school and the major. Switch/case makes the code cleaner.
Introduction to Probability and Statistics
ISBN: 978-0495389569
13th edition
Authors: William Mendenhall, Robert J. Beaver, Barbara M. Beaver