Question: Write a Java method that takes an array of type double and returns a value of type char. The parameter array stores student's numeric grades

Write a Java method that takes an array of type double and returns a value of type char. The parameter array stores student's numeric grades on a scale from 0 to 5. The method returns
the letter A if the average value of the argument array is larger than or equal to 4 ;
the letter B if the average value of the argument array is larger than or equal to 3 and less than 4 ;
the letter C if the average value of the argument array is larger than or equal to 2 and less than 3 ;
the letter D if the average value of the argument array is larger than or equal to 1 and less than 2 ;
the letter F otherwise.
The method's header is as follows.
public static char grade(double[x)
\table[[Sample run,Result],[double []x={5,4,3};,A],[char b=grade(x);,C],[\table[[double []x={1.5,2,2,5};
Write a Java method that takes an array of type

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 Finance Questions!