Assignment Input Data File Your program will read from an input file: data.txt Y

Assignment
Input Data File
Your program will read from an input file: data.txt
You’ll need to select the data and copy it to an open text file (such as open with NotePad or Word). save as plain text. .
input file has a number of data items stored in the the following order:
Global data is on the first line, as this applies to all classes. This first line holds the weights to use for all classes, in this order: program weight, midterm weight, and final exam weight.
Every other line in the file is specific to a class, and so the next line starts with a course identifier (142, 143, or 263, and this is an int).
After the course identifier, a set of lines belonging to that course are listed, each with a student ID (four digits, such as 1234), an unweighted program score, an unweighted midterm score, and an unweighted final score.
Reaching a 0 indicates the end of input for a specific class, or the end of file if all class data has been consumed.
Note that the courseData.txt file terminates with a newline character after the final zero. This means that hasNextLine will test true even after that final zero is read.
Given this data file, your program should:
Be well-documented with comments.
Read in weights, IDs, course numbers, programs scores, midterm scores, and final scores per student from the sample input file provided (using Scanner).
Calculate statistics per student and per class and report the following:Output a weighted average per student.
Output a Pass/Fail mark per student.
Output an average per class
There should be at least one method that you write that can be used to provide output for tracing variables:The method should be called test-something, e.g., testStatistics.
Somewhere in your program, there should be a call to that method. In the code you submit, that call should be commented out.
Description and Example of Program Execution
This assignment is to write a class averaging program that outputs a summary of classes and students, given the above input data. For a high-level view, look at the sample program execution below. (The report goes to the console.)
Grade Data For Class 142
ID Programs Midterm Final Weighted Average Programs grade
— ——– ——- —– —————- ————–
3333 70 60 50 59.00 Pass
4444 50 50 50 50.00 Fail
5555 80 90 80 83.00 Pass
Class Average: 64.00
Grade Data For Class 143
ID Programs Midterm Final Weighted Average Programs grade
— ——– ——- —– —————- ————–
1212 90 85 92 … Pass
6666 60 80 90 … Fail
7777 90 90 90 … Pass
8888 95 87 93 … Pass
9999 75 77 73 … Pass
Class Average: …
Grade Data For Class 263
ID Programs Midterm Final Weighted Average Programs grade
— ——– ——- —– —————- ————–
2222 . . .
8989 . . .
9090 . . .
Class Average: …
The ellipses refer to calculated values, not included in the above example but which your program should calculate.
The columns “Programs”, “Midterm”, and “Final” in the output above (i.e., from the file) are raw scores (not weighted). The only calculation that involves manipulation of weights and grades is the weighted average. The Weighted Average is calculated using the following sum of products:
(programsWeight*programsGrade) + (midtermWeight*midtermGrade) + (finalWeight*finalGrade)
The Pass/Fail determination is made based only on the raw score of the students programs. If the student’s programs score is greater than or equal to 70, they pass. If less than 70, they fail.
Finally, the real data may differ from the sample data with respect to actual scores, but will not vary with respect to file format. Meaning that the program should work with multiple files formatted in the same fashion, and not just with the values in the sample file.
Example Code Skeleton
import java.util.Scanner;
import java.io.FileInputStream;
import java.io.IOException;
public class xxx
{
//… class constants go here …
public static void main(String[] args)
{
Scanner inputFile = null; // File containing data (p. 297
// in Savitch discusses null)
// … code assigning inputFile in a try/catch statement
// … code for any stuff you need to do one time …
//Per class, print a table of ID numbers, grades, weighted average
// per student, and a Pass or Fail programs grade. The class
// average is also printed.
while (…) // be careful with hasNextLine() method
{
// Read class number, print class number title, headings.
courseNumber = inputFile.nextInt();
… rest of the code goes here …
// initialization
… code goes here …
// Loop to handle one class:
// For each student in the class, get and print their
// information, compute their avg, and sum the avgs.
while (…)
{
… code goes here …
}
// compute and print class average
… code goes here …
}
}
use something different, if needed. use nested loops, only one loop, and other methods.
txt file (add applicable commas or delimiters but leave structure as is)
0.30 0.30 0.40
550
1111 80 55 59
2222 50 70 60
3333 91 87 83
0
605
0345 95 83 98
3213 61 91 79
4456 91 95 89
1113 91 80 99
0709 72 70 73
0
765
2020 50 72 89
3030 90 55 75
4040 90 90 75
9090 35 45 65
0

Place this order or similar order and get an amazing discount. USE Discount code “GET20” for 20% discount