Main.java
import java.util.Scanner; class kor4 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] scores = {75, 82, 90, 45, 60, 88, 92, 53, 79, 81}; int sum = 0; int max = scores[0]; int min = scores[0]; int count = 0; for (int i = 0; i < scores.length; i++) { int curScore = scores[i]; sum += curScore; if (curScore > max) { max = curScore; } if (curScore < min) { min = curScore; } if (curScore >= 80) { count++; } } double average = (double) sum / scores.length; System.out.println("Total Score: " + sum); System.out.println("Average Score: " + average); System.out.println("Max Score: " + max); System.out.println("Min Score: " + min); System.out.println("Student that get 80+ Score: " + count); } }
Output