Please help trying to simplify my java code thanks.?
I’m racking your brains on a way for around method being recognized simply by another.I would really prefer the 1st applicant approach to recognize that satscore along with actscore.if post enter any 1 i would like youngster should be execute the actual satScore portion etc.I don’t have learned to get this course to fast the LAY questions 2 number ONE PARTICULAR is came into and REACT questions whenever a number ONLY TWO is came into.Do I must create an innovative method to acquire these two an approach to work together
i would really prefer to transform the code hence the execution looks like this:
The deal compares two applicants to
determine what kind seems such as the stronger
consumer.For each candidate Let me need
either SAT or WORK scores together with a weighted GPA.
Info for job seekers #1:
do you know of 1) SITTING scores as well as 2) WORK scores 1
SEATED math 450
SEATED critical studying 530
SEATED writing 490
assessment score = SIXTY.0
total GPA A FEW.4
maximum GPA FIVE.0
Transcript Multiplier 0.9
GPA fico score = 76.5
info for job seekers #2:
do you know of 1) SITTING scores as well as 2) WORK scores 2
TAKE ACTION English 25
TAKE ACTION math 20
TAKE ACTION reading 18
TAKE ACTION science 15
assessment score = 54.44
total GPA A FEW.3
maximum GPA FIVE.0
Transcript Multiplier 0.95
GPA fico score = 78.38
First applicant entire score = 136.5
Following applicant entire score = 132.82
The 1st applicant is apparently better
the eq pertaining to gpa is usually:
(actual_gpa/max_gpa)*100*transcript_mu
tranfer java.util.*;
arrest class Say that
arrest static avoid main(String args)
Code reader console = brand new Scanner(System.in);
introduction();
int applicant1 = firstApplicant (console);
int applicant2 = secondApplicant(console);
two bottle scoreOne = satScore(console);
two bottle scoreTwo = actScore(console);
scoreComparison (scoreOne, scoreTwo);
arrest static avoid introduction()
Procedure.out.println(“This plan compares two applicants to”);
Procedure.out.println(“determine what kind seems such as the stronger”);
Procedure.out.println(“applicant.For each candidate Let me need”);
Procedure.out.println(“either SITTING or WORK scores together with a weighted GPA.”);
Procedure.out.println();
arrest static int firstApplicant (Scanner console)
Procedure.out.println(“Information to the first job seekers:”);
Procedure.out.print(“do you’ve 1) SITTING sores as well as 2) WORK scores “);
int testType = unit.nextInt();
go back testType;
arrest static int secondApplicant (Scanner console)
Procedure.out.println(“Information to the second job seekers:”);
Procedure.out.print(“do you’ve 1) SITTING sores as well as 2) WORK scores “);
int testType = unit.nextInt();
go back testType;
arrest static 2 bottle satScore (Scanner console)
Procedure.out.print(“SAT math concepts “);
two bottle math = gaming system.nextDouble();
Procedure.out.print(“SAT verbal “);
two bottle verbal = gaming system.nextDouble();
Procedure.out.print(“actual GPA “);
two bottle gpa = games console.nextDouble();
Procedure.out.print(“max GPA “);
two bottle maxGPA = games console.nextDouble();
two bottle score = (2 * mental + math) / TWENTY-FOUR;
two bottle gpaScore = (gpa/maxGPA) * 250;
two bottle totalScore = score + gpaScore;
go back totalScore;
arrest static 2 bottle actScore(Scanner console)
Procedure.out.print(“ACT Language “);
int language = games console.nextInt();
Procedure.out.print(“ACT math concepts “);
int math concepts = games console.nextInt();
Procedure.out.print(“ACT reading through “);
int reading through = games console.nextInt();
Procedure.out.print(“ACT science “);
int science = games console.nextInt();
Procedure.out.print(“actual GPA “);
two bottle gpa = games console.nextDouble();
Procedure.out.print(“max GPA “);
two bottle maxGPA = games console.nextDouble();
two bottle score2 = (2 * looking through + english + cost + science) / JUST ONE.8;
two bottle gpaScore2 = (gpa/maxGPA) * 250;
two bottle totalScore2 = gpaScore2 + score2;
go back totalScore2;
arrest static avoid scoreComparison(double scoreOne, two bottle scoreTwo)
Procedure.out.println(“First consumer overall history = ” + scoreOne);
Procedure.out.println(“Second consumer overall history = ” + scoreTwo);
if (scoreOne > scoreTwo)
Procedure.out.println(“The earliest applicant is apparently better.”);
else if (scoreOne == scoreTwo)
Procedure.out.println(“The tow job hopefuls seem the same.”);
else
Procedure.out.println(“The 2nd applicant is apparently better.”);
When you eat the very first number they will enter help you save it like that:
Sacnner reviews = innovative Scanner(System.in);
int inside = source.nextInt();
if(in == 1)
Own up sat_scores = innovative Admit();
sat_scores.satScores(input);
else if(in ==2)
Own up act_scores = innovative Admit();
act_scores.actScorew(input);
That will make it so that those techniques only run while you prompt them to.
Leave a Reply
You must be logged in to post a comment.