Hello, please read the instrcutions and please look out the sample output to see
ID: 3599345 • Letter: H
Question
Hello, please read the instrcutions and please look out the sample output to see how the porgram should be. This is a beginner Java class so my knowledge is limited. For loops, if statements, parameters, nested loops, Scanner, return, printf, char.At, isLowerCase, etc. So please nothing too complex, no tokenizer or arrays yet. Thank you!
This assignment will give you practice with interactive programs, ifelse statements and methods that return values. Your program will prompt the user for information about two applicants and compute an overall score for each applicant. This is a simplified version of a program that might be used for admissions purposes. The sample log of execution indicates how your program is to behave. For each applicant, we prompt for exam scores (either SAT or ACT) and overall GPA. The exam and GPA information is turned into numbers between 0 and 100 and these two scores are added together to get an overall score between 0 and 200. After obtaining scores for each applicant, the program reports how they compare. Notice that the program asks for each applicant whether to enter SAT scores or ACT scores (SAT scores are integers that vary between 200 and 800, ACT scores are integers that vary between 1 and 36). In the case of SAT scores, the user is prompted for SAT math, reading, and writing scores. In the case of ACT scores, the user is prompted for English, math, reading and science scores. These scores are turned into a real-valued number between 0 and 100 using the following formulas: English +2 math +reading + science 1.8 For ACT scores: 2 math + reading + writing 32 For SAT scores: After computing this exam score, we compute a number between 0 and 100 based on the GPA. The program prompts for the GPA, the maximum GPA, and a transcript multiplier. All three of these are positive real values (i.e., they can have a decimal part). The transcript multiplier is a value between 0.8 and 1.0 that the admissions staff use to account for differences across students and across schools. For example, a student who takes more AP courses or a student who comes from a high school that is known to have tough grading standards will get a higher transcript multiplier. You should turn this into a score between 0 and 100 using the following formula: actual gpa max gpa 100 (transcript multiplier) At this point your program has two scores that vary from 0 to 100, one from test scores and one from GPA. The overall score for the applicant is computed as the sum of these two numbers (exam result + gpa result). Because each of these numbers is between 0 and 100, the overall score for an applicant ranges from 0 to 200 Your program is to report the exam and GPA subscores and the overall score for each applicant. These should be rounded to two decimal place when displayed. You are required toExplanation / Answer
Hi,
here is the complete code you can use,
public class HelloWorld{
public static void main(String []args){
Scanner in = new Scanner(System.in);
int t;
System.out.println("Hello World");
t = in.nextInt();
while(t--)
{
int choice;
System.out.println("Information for applicant 1:");
System.out.println("Do you have 1)SAT scores or 2)ACT scores");
choice = in.nextInt();
float overallScore=0.0;
float gpaScore=0.0;
if(choice==1)
{
int math,criticalReading,writing;
float score,gpa,maxgpa,gpscore,transcript;
System.out.println("SAT Math?");
math = in.nextInt();
System.out.println("SAT critical reading?");
criticalReading = in.nextInt();
System.out.println("SAT writing?");
writing = in.nextInt();
overallScore=(2*math+criticalReading+writing)/32;
System.out.println("exam score="+overallScore);
}
else
{
int actmath,actReading,actscience,actenglish;
float score,gpa,maxgpa,gpscore,transcript;
System.out.println("ACT English?");
actenglish = in.nextInt();
System.out.println("ACT math?");
actmath = in.nextInt();
System.out.println("ACT reading?");
actReading = in.nextInt();
System.out.println("ACT science?");
actscience = in.nextFloat();
overallScore=(2*actmath+actenglish+actReading+actscience)/1.8;
System.out.println("exam score="+overallScore);
}
System.out.println("overall GPA?");
gpa = in.nextFloat();
System.out.println("max GPA?");
maxgpa = in.nextFloat();
System.out.println("Transcript multiplier?");
transcript = in.nextFloat();
System.out.println(" GPA score?");
gpacore = in.nextFloat();
gpaScore=(gpa/maxgpa)*100*transcript
System.out.println("GPA score="+gpaScore);
System.out.println("GPA score="+gpaScore);
System.out.println("GPA score="+gpaScore);
System.out.println("GPA score="+gpaScore);
}
}
}
I will be adding the functions and o/p shortly
Thumbs up if this was helpful, otherwise let me know in comments
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.