Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What is the identifying feature for a resource-allocation problem?

Answered: 1 week ago

Question

Identify possible reasons for ineffective performance.

Answered: 1 week ago

Question

Describe the components of a needs assessment.

Answered: 1 week ago

Question

Describe the benefits of employee orientation.

Answered: 1 week ago