Question: Exercise 2. You will create a file where each line represents a student (their first name and last name) and four lab marks (all integers

Exercise 2. You will create a file where each line represents a student (their first name and last name) and four lab marks (all integers out of 10). You need to read the lines from this file using a Scanner object and then reformat the data and write the data using a PrintWriter object (students last name, first name with their average lab mark) in a new file. At the bottom of the new file also print the number of students and the average lab mark for the entire class. Below, you can see the unformatted text in Students.txt and the formatted text in Formatted.txt.Exercise 2. You will create a file where each line represents a

Exercise 2. You will create a file where each line represents a student (their first name and last name) and four lab marks (all integers out of 10). You need to read the lines from this file using a Scanner object and then reformat the data and write the data using a PrintWriter object (students last name, first name with their average lab mark) in a new file. At the bottom of the new file also print the number of students and the average lab mark for the entire class. Below, vou can see the unformatted text in Students.txt and the formatted text in Formatted.txt. Formatted.txt (after formattin Name dents.txt (before formatting Lorri Black 10 9 7 6 Jim Liam 10 9 9 8 Clem Pint 7 6 8 7 Steve Clark 3 7 9 0 Sara Term 8 10 9 10 Pete Song 9987 Stu Ave Lab Mark Black, Lorri 8.0 Liam, Jim Pint, Clem 7.0 Clark, Steve 4.75 Term, Sara 9.25 Song, Pete 8.25 9.0 Total Students: 6 Average lab class: 7.5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!