Problem

Write a method called getGrade that accepts an integer representing a student’s grade in a...

Write a method called getGrade that accepts an integer representing a student’s grade in a course and returns that student’s numerical course grade. The grade can be between 0.0 (failing) and 4.0 (perfect). Assume that scores are in the range of 0 to 100 and that grades are based on the following scale:

Score

Grade

< 60

0.0

60–62

0.7

63

0.8

64

0.9

65

1.0

 

92

3.7

93

3.8

94

3.9

>= 95

4.0

For an added challenge, make your method throw an IllegalArgumentException if the user passes a grade lower than 0 or higher than 100.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 4
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT