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
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 (...){
}
}
}
}
Sample Output This section outlines what your software is to calculate and ultimately report on the console. (If this assignment is too easy, for an added challenge, have the report be written in a GUI using JOptionPane.) Grade Data For Class 161 ID Programs Midterm Final Weighted Average 3333 4444 5555 ID 70 50 80 -- L00 OO 1 Programs 90 Class Average: 64.00 Grade Data For Class 162 90 60 90 95 75 60 LO ---- I 2222 8989 9090 Class Average: 50 OC 1212 6666 7777 8888 9999 Class Average: Grade Data For Class 263 Midterm Final ... 85 80 90 87 77 ==== 50 50 80 1666 92 90 90 93 73 59.00 50.00 83.00 Weighted Average Programs grade Pass Fail Pass Programs grade Pass Fail Pass Pass Pass ID Programs Midterm Final Weighted Average Programs grade
Step by Step Solution
3.48 Rating (155 Votes )
There are 3 Steps involved in it
Step: 1
import javaio import javautil import javatext class main public static double computeString tempStri...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