import java.util.Scanner;
* MIT170671.java : a program that prompts the user for information about two
* applicants and that computes an overall score for each applicant
public class MIT170671 {
* Method to take the input from the user and returns the total exam score
* for SAT exam
* @param scan
* scanner object to take the input
* @return exam score for SAT exam
public static double getSatScore(Scanner scan) {
System.out.print(“SAT Math? “);
int math = scan.nextInt();
System.out.print(“SAT verbal? “);
int verbal = scan.nextInt();
System.out.print(“overall GPA? “);
double overallGPA = scan.nextDouble();
System.out.print(“max GPA? “);
double maxGPA = scan.nextDouble();
double satScore = MIT170671.calculateSATScore(verbal, math);
double gpaScore = MIT170671.calculateGPA(maxGPA, overallGPA);
return (satScore + gpaScore);
* Method to take the input from the user and returns the total exam score
* for ACT exam
* @param scan
* scanner object to take the input
* @return exam score for ACT exam
public static double getActScore(Scanner scan) {
System.out.print(“ACT English? “);
int english = scan.nextInt();
System.out.print(“ACT Math? “);
int math = scan.nextInt();
System.out.print(“ACT reading? “);
int reading = scan.nextInt();
System.out.print(“ACT science? “);
int science = scan.nextInt();
System.out.print(“overall GPA? “);
double overallGPA = scan.nextDouble();
System.out.print(“max GPA? “);
double maxGPA = scan.nextDouble();
double actScore = MIT170671.calculateACTScore(english, math, reading, science);
double gpaScore = MIT170671.calculateGPA(maxGPA, overallGPA);
return (actScore + gpaScore);
* To calculate the SAT score using the given condition.
* @param verbal
* marks of verbal subject
* @param math
* marks of math subject
* @return calculated SATScore
public static double calculateSATScore(int verbal, int math) {
return (double) (((2 * verbal) + math) / 24.0);
* To calculate the ACT score using the given condition.
* @param english
* marks of english subject
* @param math
* marks of math subject
* @param reading
* marks of reading
* @param science
* marks of science subject
* @return calculated ACTScore
public static double calculateACTScore(int english, int math, int reading, int science) {
return (double) (((2 * reading) + english + math + science) / 1.8);
* To calculate the GPA score using the given condition.
* @param maxGPA
* maximum GPA
* @param overallGPA
* GPA provided by the user
* @return calculated GPAScore
public static double calculateGPA(double maxGPA, double overallGPA) {
return (overallGPA / maxGPA) * 100;
* This method will compare the scores that are passed as arguments and
* prints the corresponding output in the console.
* @param firstApplicantScore
* score of the first applicant
* @param secondApplicantScore
* score of the second applicant
public static void compareScore(double firstApplicantScore, double secondApplicantScore) {
if (firstApplicantScore > secondApplicantScore) {
System.out.println(“The first applicant seems to be better”);
} else if (firstApplicantScore < secondApplicantScore) {
System.out.println(“The second applicant seems to be better”);
} else {
System.out.println(“The two applicants seem to be equal”);
* To get the first Applicant score. Based on the choice, the corresponding
* method is invoked either SAT or ACT.
* @param scan
* scanner object to take the input
* @return score of the first applicant
public static double getFirstApplicantScore(Scanner scan) {
double firstApplicantScore = 0;
System.out.print(“nInformation for the first applicant:” + “ndo you have 1) SAT scores or 2) ACT scores?”);
int choice = scan.nextInt();
if (choice == 1) {
firstApplicantScore = MIT170671.getSatScore(scan);
} else if (choice == 2) {
firstApplicantScore = MIT170671.getActScore(scan);
return firstApplicantScore;
* To get the second Applicant score. Based on the choice, the corresponding
* method is invoked either SAT or ACT.
* @param scan
* scanner object to take the input
* @return score of the second applicant
public static double getSecondApplicantScore(Scanner scan) {
double secondApplicantScore = 0;
System.out.print(“nInformation for the second applicant:” + “ndo you have 1) SAT scores or 2) ACT scores?”);
int choice = scan.nextInt();
if (choice == 1) {
secondApplicantScore = MIT170671.getSatScore(scan);
} else if (choice == 2) {
secondApplicantScore = MIT170671.getActScore(scan)
return secondApplicantScore;
* Execution begins here. First and second applicant scores are calculated
* and printed on the console.
* @param args
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
double firstApplicantScore = MIT170671.getFirstApplicantScore(scan);
double secondApplicantScore = MIT170671.getSecondApplicantScore(scan);
System.out.println(“nFirst applicant overall score = ” + firstApplicantScore);
System.out.println(“Second applicant overall score = ” + secondApplicantScore);
MIT170671.compareScore(firstApplicantScore, secondApplicantScore)
References:
[1] K. Sierra and B. Bates, Head First Java, 1st ed. Sebastopol: O’Reilly Media, Inc., 2008.
[2] H. Schildt, Java: The Complete Reference, 9th ed. McGraw-Hill education, 2017.
Essay Writing Service Features
Our Experience
No matter how complex your assignment is, we can find the right professional for your specific task. Contact Essay is an essay writing company that hires only the smartest minds to help you with your projects. Our expertise allows us to provide students with high-quality academic writing, editing & proofreading services.Free Features
Free revision policy
$10Free bibliography & reference
$8Free title page
$8Free formatting
$8How Our Essay Writing Service Works
First, you will need to complete an order form. It's not difficult but, in case there is anything you find not to be clear, you may always call us so that we can guide you through it. On the order form, you will need to include some basic information concerning your order: subject, topic, number of pages, etc. We also encourage our clients to upload any relevant information or sources that will help.
Complete the order formOnce we have all the information and instructions that we need, we select the most suitable writer for your assignment. While everything seems to be clear, the writer, who has complete knowledge of the subject, may need clarification from you. It is at that point that you would receive a call or email from us.
Writer’s assignmentAs soon as the writer has finished, it will be delivered both to the website and to your email address so that you will not miss it. If your deadline is close at hand, we will place a call to you to make sure that you receive the paper on time.
Completing the order and download