Question: In a class named Grades, write a method named grade that accepts an integer parameter representing a student's course grade from 0 to 100 and

In a class named Grades, write a method named grade that accepts an integer parameter representing a student's course grade from 0 to 100 and returns the student's course grade on the 4.0 scale. Save as Grades.java,Use the following mapping:

Score <=60 61 62 63 ... 98 99 100
Grade 0.0 0.1 0.2 0.3 ... 3.8 3.9 4.0

Before writing the code, you will need to figure out the pattern in the mapping. May not use if and/or if/else statements. (HINT: Math.max or Math.min may be helpful to you)

Your class should also include a main method with tests of the grade method. Example expected return values for certain score parameters:

Parameter = 0, Return value = 0.0 Parameter = 45, Return value = 0.0 Parameter = 60, Return value = 0.0 Parameter = 63, Return value = 0.3 Parameter = 80, Return value = 2.0 Parameter = 90, Return value = 3.0 Parameter = 95, Return value = 3.5 Parameter = 100, Return value = 4.0 

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!