Question: Calculate the average score for each student and identify the student with the highest average score. Output the number of that student (0-11). Java. Scores

Calculate the average score for each student and identify the student with the highest average score. Output the number of that student (0-11). Java. Scores are read from text file. Please help me figure this out. Thank you in advance!

My code so far:

package com.company; import java.util.*; import java.lang.*; import java.io.*; public class Main { static final int STUDENTS = 12; static final int SCORES = 10; public static void main(String[] args) throws FileNotFoundException { File file = new File("input.txt"); Scanner stdin = new Scanner(file); int[][] quizScores = new int[STUDENTS][SCORES]; for (int student = 0; student < STUDENTS; ++student) { for (int score = 0; score < SCORES; ++score) { quizScores [student][score] = stdin.nextInt(); } System.out.println(); } System.out.println("The scores are: "); for (int students = 0; students < STUDENTS; ++students) { for (int scores = 0; scores < SCORES; ++scores) { System.out.print(quizScores[students][scores] + " "); } System.out.println(); } } } 

text file:

9 8 7 6 7 8 9 8 7 6 8 7 6 5 4 3 5 6 7 8 9 8 7 8 9 9 9 9 9 9 1 2 3 4 5 6 7 7 8 9 2 3 3 5 6 7 7 8 9 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 9 9 9 7 6 6 6 6 6 6 6 6 4 2 3 5 6 7 8 7 7 6 5 8 9 8 7 6 6 8 9 9 10 3 3 3 8 6 4 5 7 9 2 1 1 1 1 3 2 5 5 2 3 

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