Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hi, am creating a java program that compare two applicants ACT,SAT, and GPA, and

ID: 440680 • Letter: H

Question

Hi, am creating a java program that compare two applicants ACT,SAT, and GPA, and i am try to put everything into a method. Can some one help me please? public static void main(String[] args) { System.out.println("This program reads data for two people and"); System.out.println("computes scholastic aptitude test (SAT), ACT, and G.P.A.."); System.out.println(); Scanner console = new Scanner(System.in); int sat1 = SAT(console); int act1 = SAT(console); System.out.println("SAT scores are integers that vary between 200 and 800"); System.out.println(); // ask for SAT score for both applicates System.out.println("Enter first person's SAT information:"); System.out.println(); } public static int SAT (Scanner console) { System.out.print("math "); double math1 = console.nextDouble(); System.out.print("Verbal "); double verbal1 = console.nextDouble(); double sat1 = (2* verbal1 + math1/ 24); System.out.println(); System.out.println("person #1 SAT =%5.2f " + sat1); System.out.println(); System.out.println("Enter second person's SAT information:"); System.out.print(" SAT math "); double math2 = console.nextDouble(); System.out.print("SAT Verbal "); double verbal2 = console.nextDouble(); double sat2 = (2* verbal2 + math2 / 24); System.out.println(); System.out.println("person #2 SAT =%5.2f " + sat2); System.out.println(); System.out.println(); } { System.out.println("ACT scores are integers that vary between 1 and 36"); System.out.println(); { // ask for ACT. score for both applicates System.out.println("Enter first person's ACT information:"); { public static int ACT (Scanner console) { System.out.print(" ACT math "); double mathact1 = console.nextDouble(); System.out.print("ACT English "); double englishact1 = console.nextDouble(); System.out.print("ACT Science "); double scienceact1 = console.nextDouble(); System.out.print("ACT Reading "); double readingact1 = console.nextDouble(); double act1 = (2* mathact1 + readingact1 + scienceact1 + englishact1 / 1.8); System.out.println(); System.out.println("person #1 ACT =%5.2f " + act1); System.out.println(); System.out.println("Enter second person's ACT information:"); System.out.print(" ACT math "); double mathact2 = console.nextDouble(); System.out.print("ACT English "); double englishact2 = console.nextDouble(); System.out.print("ACT Science "); double scienceact2 = console.nextDouble(); System.out.print("ACT Reading "); double readingact2 = console.nextDouble(); double act2 = (2* mathact2 + readingact2 + scienceact2 + englishact2/ 1.8); System.out.println(); System.out.println("person #2 ACT =%5.2f " + act2); System.out.println(); System.out.println("G.P.A.information is on a college 4.0 decimal scale"); System.out.println(); System.out.println(); // ask for G.P.A. score for both applicates System.out.println("Enter first person's G.P.A. information:"); System.out.print(" G.P.A.grade in decimal point "); double gpa1 = console.nextDouble(); double Gpa1 = ((gpa1*1.0)*100); System.out.println(); System.out.println("person #1 GPA =%5.2f " + gpa1); System.out.println( "Max g.p.a. 4.0"); System.out.println(); System.out.println("Enter second person's G.P.A. information:"); System.out.print(" G.P.A.grade in decimal point "); double gpa2 = console.nextDouble(); double Gpa2 = ((gpa2*1.0)*100); System.out.println(); System.out.println("person #1 GPA =%5.2f " + gpa2); System.out.println( "Max g.p.a. 4.0"); System.out.println(); // overall SAT score prompt System.out.println("First applicant overall SAT = " + sat1); System.out.println("Second applicant overall SAT = " + sat2); if (sat1 < sat2) { System.out.println("The second applicant seems to be better"); } else if (sat1 == sat2) { System.out.println("The two applicants seem to be equal"); } else { // score1 > score2 System.out.println("The first applicant seems to be better"); System.out.println(); } // overall ACT score prompt System.out.println("First applicant overall ACT = " + act1); System.out.println("Second applicant overall ACT = " + act2); if (act1 < act2) { System.out.println("The second applicant seems to be better"); } else if (act1 == act2) { System.out.println("The two applicants seem to be equal"); } else { // score1 > score2 System.out.println("The first applicant seems to be better"); System.out.println(); } // overall G.P.A. score prompt System.out.println("First applicant overall gap = " + gpa1); System.out.println("Second applicant overall gpa = " + gpa2); if (gpa1 < gpa2) { System.out.println("The second applicant seems to be better"); } else if (gpa1 == gpa2) { System.out.println("The two applicants seem to be equal"); } else { // score1 > score2 System.out.println("The first applicant seems to be better"); System.out.println(); } } } } }

Explanation / Answer

User arrayList to store the data of each applicant. and then you can use comparable interface to compare any field of the applicant. http://www.tutorialspoint.com/java/java_arraylist_class.htm http://javarevisited.blogspot.in/2011/06/comparator-and-comparable-in-java.html http://www.vogella.com/blog/2009/08/04/collections-sort-java/

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote