Question: I think FileInputStream and FileOutputStream should also be used. There is a file named ClassList.dat which needs to be read. Please make it very simple,

I think FileInputStream and FileOutputStream should also be used. There is a file named ClassList.dat which needs to be read. Please make it very simple, First-Year Student simple. :)
Part 2 - Byte 1/0 (4 points) Objectives: Learn about binary file 1/0 reading and writing. Description: Write a program (no GUI required), CalcAverages.java, that reads a binary file ClassList.dat, calculating the grades and prints the results. The file layout is as follows: Data type UTE Integer double double double double Data item Student Name Student number Grade in class 1 Grade in class 2 Grade in class 3 Grade in class 4 Requirements: Read the binary data file, not knowing how many records are in the file. Compute the average of each student's grades, and print the average as the last column of the data read. There are three lines of output shown. However, the data file contains more data than this. Do not program for only three people. The program must handle all the data, and terminate without errors. Use the printf or String.format method for formatting. Make sure your headings and column output matches exactly Partial sample of the output: Name ID Gradel Grade 2 Grade 3 Grade 4 Josephyn Brown 192837873 72.5 George Foreman 678374875 98.5 88.9 Fred Brown 992893456 92.4 82.4 81.1 Avg. 92.7 63.6 76.9 91.1 91.1 75.6 72.5 78.4 Part 2 - Byte 1/0 (4 points) Objectives: Learn about binary file 1/0 reading and writing. Description: Write a program (no GUI required), CalcAverages.java, that reads a binary file ClassList.dat, calculating the grades and prints the results. The file layout is as follows: Data type UTE Integer double double double double Data item Student Name Student number Grade in class 1 Grade in class 2 Grade in class 3 Grade in class 4 Requirements: Read the binary data file, not knowing how many records are in the file. Compute the average of each student's grades, and print the average as the last column of the data read. There are three lines of output shown. However, the data file contains more data than this. Do not program for only three people. The program must handle all the data, and terminate without errors. Use the printf or String.format method for formatting. Make sure your headings and column output matches exactly Partial sample of the output: Name ID Gradel Grade 2 Grade 3 Grade 4 Josephyn Brown 192837873 72.5 George Foreman 678374875 98.5 88.9 Fred Brown 992893456 92.4 82.4 81.1 Avg. 92.7 63.6 76.9 91.1 91.1 75.6 72.5 78.4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
