Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Each line of a text-file grades.txt contains a student ID and his grades in 5 quizzes: 900123080.0 90.0 70.5 100.0 60.0 9001232 98.0 85.0 100.0
Each line of a text-file grades.txt contains a student ID and his grades in 5 quizzes: 900123080.0 90.0 70.5 100.0 60.0 9001232 98.0 85.0 100.0 99.0 89.0 9001234 90.0 72.0 0.0 78.0 98.0 9001236 85.0 72.5 95.0 75.0 64.5 9001238 67.0 11.028.0 89.585.0 Given that the number of students is 5, write a Java program that reads the data from grades.txt into an integer 1D-array of student IDs and the corresponding quiz grades in a parallel 2D-array of type double. The program then calls the method studentAverages that receives the 2D array of grades and returns a 1D-array containing the average of each student. The main method finally prints an output in the format: ID 9001230 9001232 9001234 9001236 9001238 Quiz Average 80.1 94.2 67.6 78.4 56.1 Note: . Your program must use appropriate loops Your program must be general; it must work for any text-file with the above format The studentAverages method must not contain input and output statements
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started