Question
import java.util.*; //contains Scanner class AdmitLabTest { public static void main(String[] args) { Scanner sc4 = new Scanner(System.in); System.out.println(Welcome to Admissions Applicant Comparison System); System.out.println(Information
import java.util.*; //contains Scanner class AdmitLabTest {
public static void main(String[] args) { Scanner sc4 = new Scanner(System.in); System.out.println("Welcome to Admissions Applicant Comparison System"); System.out.println("Information for applicant #1: "); int ch1; double Applicant1Score, Applicant2Score; //get the examType of applicant 1 and calculate the scores System.out.println("Enter type of examination score for applicant 1: 1.SAT 2.ACT "); ch1 = sc4.nextInt(); Applicant1Score = Applicant1ScoreCalculation(ch1); //get the examType of applicant 2 and calculate the scores System.out.println("Enter type of examination score for applicant 2: 1.SAT 2.ACT "); ch1 = sc4.nextInt(); Applicant2Score = Applicant2ScoreCalculation(ch1); //compare scores of applicants if (Applicant1Score > Applicant2Score) System.out.println("The First applicant seems to be better"); else if (Applicant1Score < Applicant2Score) System.out.println("The Second applicant seems to be better"); else System.out.println("The two applicants seem to be equal");
char SatOrAct = typeScore(); if(SatOrAct == 'S'){ int mathScore = get(E)xamScore(SatOrAct=='S', "MATH"); int readingScore = get(E)xamScore(SatOrAct=='S', "READING"); int writingScore = get(E)xamScore(SatOrAct=='S', "WRITING"); double normSAT = normalizedSAT(mathScore, readingScore, writingScore); System.out.println(normSAT); } else{ int englishScore = get(E)xamScore(SatOrAct=='S', "ENGLISH"); int mathScore = get(E)xamScore(SatOrAct=='S', "MATH"); int readingScore = get(E)xamScore(SatOrAct=='S', "READING"); int scienceScore = get(E)xamScore(SatOrAct=='S', "SCIENCE"); double normACT = normalizedACT(mathScore, readingScore, englishScore, scienceScore); System.out.println(normACT); normalizedGPA(); } }//end main() method public static char typeScore() {
//Prompt user System.out.println("Enter type of examination score for applicant 1: (S)AT OR (A)CT "); //Declare scanner Scanner sc = new Scanner(System.in); //Scan user input, taking character at the 0 position char reply = sc.next().charAt(0); //Converting it to ascii value int ascii = (int) reply; //Comparing if it's a, s or neither if(ascii == 65 || ascii == 97) { return 'A'; } else if(ascii == 83 || ascii == 115){ return 'S'; } else{ throw new IllegalArgumentException("Illegal response"); } }//end typeScore() method public static int getExamScore(boolean SAT_Score, String prompt) { Scanner sc2 = new Scanner(System.in); if(SAT_Score == true){ System.out.println("Enter " + prompt + " score between 200 and 800: "); int input = sc2.nextInt(); if(!(input>=200 && input<=800)){ throw new IllegalArgumentException("Illegal response"); } else{ return input; } } else{ System.out.println("Enter " + prompt + " score between 1 and 36: "); int input = sc2.nextInt(); if(!(input>=1 && input<=36)){ throw new IllegalArgumentException("Illegal response"); } else{ return input; } } }//end get(E)xamScore() method public static double normalizedGPA() { //get input score from user Scanner sc3 = new Scanner(System.in); System.out.println("Enter Overall GPA: "); double GPA = sc3.nextDouble(); System.out.println("Enter MAX GPA: "); double MAXGPA = sc3.nextDouble(); System.out.println("Enter transcript multiplier: "); double transcriptMultiplier = sc3.nextDouble(); //calculate GPA score using given formula double score = (GPA / MAXGPA) * 100 * transcriptMultiplier; return score; }
public static double normalizedSAT(int math, int reading, int writing) { double normScore = (2 * math + reading + writing)/32.0; return normScore; }//end normalizedSAT() method public static double normalizedACT(int math, int reading, int english, int science) { double normScore = (english + 2 * math + reading + science)/1.8; return normScore; }//end normalizedACT() public static double Applicant1ScoreCalculation(int get(E)xamScore, int normalizedGPA, int normalizedSAT, int normalizedACT, int overallScore, int ch, int GPAScore) { //if choice is 1 calculate SAT Score if (ch == 'S') { get(E)xamScore = normalizedSAT; } else{ //if choice is 2 calculate ACT Score get(E)xamScore = normalizedACT; //calculate GPA score of applicant 1 GPAScore = normalizedGPA; //calculate overall score overallScore = get(E)xamScore + normalizedGPA; //print the scores of Applicant 1 System.out.printf("The examination score of Applicant 1 is: %.1f ",get(E)xamScore); System.out.printf("The GPA score of Applicant 1 is: %.1f ",GPAScore); System.out.printf("The overall score of Applicant 1 is: %.1f ",overallScore); return overallScore; } } public static double Applicant2ScoreCalculation(int get(E)xamScore, int normalizedGPA, int normalizedSAT, int normalizedACT, int overallScore, int GPAScore, int overalScore, int ch) { //double getexamScore, normalizedGPA, normalizedACT, overallScore, GPAScore; //if choice is 1 calculate SAT Score if (ch == 1) get(E)xamScore = normalizedSAT; else //if choice is 2 calculate ACT Score get(E)xamScore = normalizedACT; //calculate GPA score of applicant 2 GPAScore = normalizedGPA; //calculate overall score overallScore = get(E)xamScore + GPAScore; //print the scores of Applicant 2 System.out.printf("The examination score of Applicant 2 is: %.1f ",get(E)xamScore); System.out.printf("The GPA score of Applicant 2 is: %.1f ",GPAScore); System.out.printf("The overall score of Applicant 2 is: %.1f ",overallScore); return overallScore; }
}//end AdmitLab class I am supposed to make the code ask for 2 applicant scores asking A for ACT and S for SAT. and then the user will input their scores and the code should compare the 2 applicants with 3 possible outputs. Since chegg wont let me use the word "E X A M" even thought it is just homework I put all the E X A M words like (E)xam in the code.The end code should look like this:
"
Welcome to Admissions Applicant Comparison System
Information for Applicant #1:
Do you have (S)AT scores or (A)CT scores? __
Enter MATH score between 200 and 800: __
Enter READING score between 200 and 800: __
Enter WRITING score between 200 and 800: __
Overall GPA? __
max GPA? __
Transcript Multiplier? __
(E)xam score = (Code calculates this score)
GPA score = (Code calculates this score)
Information for Applicant #:
Do you have (S)AT scores or (A)CT scores? __
Enter ENGLISH score between 1 and 36: __
Enter MATH score between 1 and 36: __
Enter READING score between 1 and 36: __
Enter SCIENCE score between 1 and 36: __
Overall GPA? __
max GPA? __
Transcript Multiplier? __
(E)xam score = (Code calculates this score)
GPA score = (Code calculates this score)
First applicant overall Score = (Code calculates this score)
Second applicant overall score = (Code calculates this score)
The "Blank" applicant seems to be better(Code compares the scores to both applicants)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started