Question: Using java language 4. Write a Java program that contains a main method and two getGrade methods. One version of getGrade has a single int
4. Write a Java program that contains a main method and two getGrade methods. One version of getGrade has a single int parameter; the other has two int parameters. The first version of getGrade returns the letter grade that corresponds to the test score it is passed. Test scores and their corresponding letter grades are as follows: Test Score Letter Grade 90-100 80-89 70-79 65-69 0-64 For example, the call of getGrade in the following statement should return (not dis- play) the char value 'B' char grade = getGrade (81); The second version of getGrade is passed two test scores. It returns the grade that corresponds to the average of the two test scores it is passed. It should a. determine the average of the two numbers it is passed; b. call the first version of getGrade, passing it the average to get the corresponding letter grade; and c. return the letter grade it gets in Sikep (b). main should call getGrade three times, once passing it 64, once passing it 99, and once passing it both and the corresponding letter grade obtained from getGrade. The display produced by main should look like this: 64 gets the grade F 99 gets the grade A 73 and 91 gets the grade B 7 3 and 91. For each call, main should display the score or scores
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
