Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

ok so I have a program that finds the highest, lowest and average grade using ar

ID: 3542823 • Letter: O

Question

ok so I have a program that finds the highest, lowest and average grade using arrays, but I need to use loops in the code as per the following instructions.


Do not need to use array to save each input score for this lab. A Single

loop to read in each grade, compare with the current highest grade, lowest grade, and

calculate the running sum at the same time.


Here is what I have so far




import java.util.*;

public class HighestScore


{

public static void main(String[] args)

{

int num =0;

Scanner in = new Scanner(System.in);

System.out.println("Please input the total number of students: ");

num = in.nextInt();

int[] grade_array = new int[num];

int sum =0;

System.out.println("Please input the students

Explanation / Answer

import java.util.*;
public class HighestScore
{
public static void main(String[] args)
{
int num =0;
Scanner in = new Scanner(System.in);
System.out.println("Please input the total number of students: ");
num = in.nextInt();
int sum =0;
int max = 0;
int min=100;
System.out.println("Please input the students