Question
Develop a method called normalizeGrades() in Java following the details below: The method should accept an array of numeric grades as argument. Each grade in
Develop a method called normalizeGrades() in Java following the details below:
- The method should accept an array of numeric grades as argument. Each grade in the array is a numeric value (of type double) between 0 to 100.
- The method should make an integer array of grades, following:
- If a grade in the array is greater than 50, then the method should round the numeric grade to the nearest integer value using Math.round() method, and then again round it to an integer grade to a nearest multiple of 5.
- If a grade in the array is less than or equal to 50, then the method should round the numeric grade to the nearest integer value using Math.round() method.
- The method should make a character array of letter grades, using a switch statement by translating the integer grades created in (b) to an array of letter grades of type character, following the grade notation:
100 or 95 or 90 85: A
70, 75, 80: B
55, 60, 65: C
50: D
0 to 49: F
- The method should print the integer array of grades.
- The method should return the array of letter grades created in (c).
For example:
If the input array is:
{100, 28.2, 83.3, 76.1, 56, 36, 73, 72.49, 62.5, 92.1, 57.5, 49.5, 52.4}
The method should make and print an integer array:
[100, 28, 85, 75, 55, 36, 75, 70, 65, 90, 60, 50, 50]
The method should return the character array of letter grades:
{A, F, A, B, C, F, B, B, C, A, C, D, D}
Submission instructions:
Please submit only the java code of method normalizeGrades()in the answer textbox by cut/paste or by directly coding in the textbox.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started