Question: Average GradeGiven an Array grades, find the maximum, the minimum, and the average.Use the text formatter with System.out.printf ( ) to print out each result

Average GradeGiven an Array grades, find the maximum, the minimum, and the average.Use the text formatter with System.out.printf() to print out each result on its own line.
Use: %.2f%n to print each result
Label the results: "Max Grade: ", "Min Grade: ", and "Average Grade: "
System.out.printf("Max Grade: %.2f%n", result);
import java.io.*;
import java.util.*;
public class GradeMaxAndMin {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int numOfInputs = in.nextInt();
double[] grades = new double[numOfInputs];
for (int index =0; index < numOfInputs; index++){
grades[index]= in.nextDouble();
}
in.close();
/***** DO NOT CHANGE THE CODE ABOVE THIS LINE *****/
// WRITE YOUR CODE HERE
}// end of main()
}
STDOUT
Expected STDOUT
MaxGrade:99.00
MinGrade:33.00
AverageGrade:75.70

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