Question: I created this code in java, using the eclipse neon IDE. It runs until an there is an exception that something is found. Please post

I created this code in java, using the eclipse neon IDE. It runs until an there is an exception that something is found. Please post the corrected code(not as an image). This is fairly simple code. I also need to have the doubles rounded to one decimal place. Thank you. This should all be in one class, not multiple.

import java.util.Scanner;

public final class Applicant { public static void main(String [] args) { applicant(); //results();

} //method for SAT applicant public static double SAT(){ Scanner input; input = new Scanner(System.in); System.out.println("SAT math ?"); int m = input.nextInt(); System.out.println("SAT reading?"); int r = input.nextInt(); System.out.println("SAT writing ?"); int w = input.nextInt(); double score = ((2*m)+r+w)/32; System.out.println("Exam Score = " + score); System.out.print("Overall GPA ?"); double actualGpa=input.nextDouble(); System.out.print("Max GPA ?"); double maxGpa=input.nextDouble(); System.out.print("Transcript Multiplier ?"); double tsp=input.nextDouble(); double gpaScore=(actualGpa/maxGpa)*100*tsp; System.out.println("GPA Score = "+gpaScore); double overallscore1=(score+gpaScore); input.close(); return overallscore1; //System.out.println("first Applicant OverallScore = "+overallscore1); } //method for ACT applicant public static double ACT(){ Scanner input; input = new Scanner(System.in); System.out.print("ACT English ?"); int e=input.nextInt(); System.out.print("ACT Math ?"); int m=input.nextInt(); System.out.print("ACT reading ?"); int r=input.nextInt(); System.out.print("ACT Science ?"); int s=input.nextInt(); double score =(e+(2*m)+r+s)/1.8; System.out.println("Exam Score: "+score); System.out.print("Overall GPA ?"); double actualGpa=input.nextDouble(); System.out.print("Max GPA ?"); double maxGpa=input.nextDouble(); System.out.print("Transcript Multiplier ?"); double tsp=input.nextDouble(); double gpaScore=(actualGpa/maxGpa*100*tsp); System.out.println("GPA Score = "+gpaScore);

double overallscore2= (score+gpaScore); input.close(); return overallscore2; //System.out.println("first Applicant OverallScore = "+overallscore2); } //uses if statement to choose SAT or ACT method to run public static void applicant(){ Scanner input; input = new Scanner(System.in); for(int i=1;i<=2;i++) { System.out.println("Information for applicant #"+i+":"); System.out.println("Which of the following do you have: 1) SAT scores, or 2) ACT scores ?");

int choice = input.nextInt(); if (choice == 1) { SAT(); } else if(choice==2) { ACT(); } else { System.out.println("Not an option, Choose 1 or 2 only"); //just restarts back at applicant method, no info saved from prior entries applicant(); } } input.close(); }

public static void results(double overallscore1, double overallscore2){ System.out.println("overallsCore of applicant 1:"+overallscore1); System.out.println("Overallscore of applicant 2 :"+overallscore2); if(overallscore1>overallscore2){ System.out.println("The first Applicant is better than Second Applicant");} else if (overallscore1 System.out.println("second Applicant is better than First Applicant");} else{ System.out.println("Both are good"); } } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!