Write a class averaging program that outputs a summary of classes and students, given input data in
Question:
Write a class averaging program that outputs a summary of classes and students, given input data in a specific format. For a high-level view, look at the sample program execute below. Your program will read from an input file (data.txt) a number of data items, stored in the file in the following order:
data.txt:
0.30 0.30 0.40 161 3333 70 60 50 4444 50 50 50 5555 80 90 80 0 162 1212 90 85 92 6666 60 80 90 7777 90 90 90 8888 95 87 93 9999 75 77 73 0 263 2222 90 65 75 8989 60 40 60 9090 70 80 30 0
(1) GLobal data is on the first line, as this applies to all classes. This first line holds the weights to the use for all classes, in this order: program weight, midterm weight, and final exam weight.
(2) Every other line in the file is specific to a class, and so the next line starts with a course identifier (161, 162, or 263, and this is an int).
(3) After the course identifier, a set of lines belonging to that course are listed, each with a student ID (4 digits, such as 1234), an unweighted program score, an unweighted midterm score, and an unweighted final score.
(4) Reaching a 0 indicates the end of input for a specific class, or the end of file if all class data has been consumed.
Given this date file, the program should:
(1) Read in weights, IDs, course numbers, programs scores, midterm scores, and final scores per student from the sample input file provided (using Scanner or FileReader);
(3) Calculate statistics per student and per class and report the following:
a. Output a weighted average per student
b. Output a Pass/Fail mark per student
c. Output an average pr class
(4) Output should be compared against the sample output below for accuracy
(5) There should be at least one method that you write that can be used to provide output for tracing variables:
a. The method should be called test-something, e.g., testStatistics;
b. Somewhere in your program, there should be a call to that method. In the code you submit, that call should be commented out, but I should be able to find it.
Skeleton Code:
import java.util.Scanner;
import java.util.File;
import java.io.IOException;
public class ... {
public static void main(String[] args){
int courseNumber;
for (...) {
while (...){
}
}
}
}