Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please follow the instructions in the images! Do NOT use: clone() method, while(true), catch/try, buffer reader, throws, private/final, private static. Please use: FileNotFoundException in main

Please follow the instructions in the images! Do NOT use: clone() method, while(true), catch/try, buffer reader, throws, private/final, private static. Please use: FileNotFoundException in main method, Scanner f = new Scanner(new File("A1.txt")); File is below - Buzz 777 8 6 7 9 10 8 9 8 7 10 0 46 38 42 40 40 85 Hamm 107 7 7 7 9 9 8 8 8 7 8 0 34 35 30 28 32 70 Jessie 123 10 10 10 10 10 10 10 10 10 10 10 50 50 50 50 49 99 Rex 666 8 10 9 9 10 7 9 8 9 10 10 50 46 48 44 45 90 Slinky 301 8 6 6 9 9 7 0 7 10 8 8 28 0 40 30 24 50 Woody 300 6 7 7 7 6 8 9 8 7 7 8 40 35 35 42 35 72

image text in transcribedimage text in transcribedimage text in transcribed

Write a program called CourseMarks that reads data from a file called Al.txt. The file contains a list of students and their name, student number, 11 lab marks, 4 assignment marks and 2 exam marks (midterm and final). Store each of the name, student number and marks in parallel arrays, where each array is related. Use 2D arrays for the lab, assignment and exam marks (i.e. a 2D array for each student's 11 lab marks, another for 4 assignment marks and a third for the 2 exam marks). Initial data: Name Final (100) 85 Buzz Hamm 32 Student# 777 107 123 666 301 300 Jessie 8 7 10 8 8 6 6 7 10 10 6 7 7 7 10 9 6 7 Labs (each out of 10) 9 10 8 9 8 9 9 8 8 8 10 10 10 10 10 9 10 7 9 8 9 9 7 0 7 7 6 8 9 8 7 7 10 9 10 7 Assignments Midterm (50) 0 46 38 42 40 40 0 34 35 30 28 10 50 50 50 50 10 50 46 8 28 8 40 10 8 10 10 8 7 Rex Slinky 40 30 Woody Individual components of the course are weighted as follows: - 10 labs: 10% of final mark (weighted evenly, best 10 of 11) - 4 labs: 15 % of final mark (weighted evenly) - Midterm exam: 25% of final mark - Final exam: 50% of final mark When the program runs, display the data summarized in the following format: Student Buzz Hamm Jessie Rex Slinky Woody # 777 107 123 666 301 300 Labs Asl 8.2 3.5 7.8 2.6 10.0 3.8 9.2 3.8 7.8 2.1 7.4 3.0 As2 2.9 2.6 3.8 3.5 0.0 2.6 As 3 3.2 2.3 3.8 3.6 3.0 2.6 As 4 3.0 2.1 3.8 3.3 2.3 3.2 Mid 20.0 16.0 24.5 22.5 12.0 17.5 Final Mark 42.5 83.2 35.0 68.3 49.5 99.0 45.0 90.8 25.0 52.2 36.0 72.3 Note that the Labs column contains the overall lab mark the student received out of 10 (the lowest mark is dropped). The assignments and exams are displayed with their respective weighting, and the total overall mark is displayed. The user will then be given an option to change a student's mark. The system prompts the user for the lab/assignment/exam to change, and the student number and new mark. The system confirms the change and displays the summary again. Include methods calculateWeightedMarks, displaySummary, and change Student Mark. Notes: . Use the size of the sample data for initializing array lengths - to format a double to 1 decimal place, use String.format("$.lf", value) . ArrayLists should not be used, but you may use other utilities from the Java Class Libraries. - Use auxiliary arrays as needed Sample output (text in blue is user input): As3 3.2 Hamm ---Final Marks--- Student Labs Asi Buzz 777 8.2 3.5 107 7.8 2.6 Jessie 123 10.0 3.8 Rex 666 9.2 3.8 Slinky 301 7.8 2.1 Woody 300 7.4 3.0 As 2 2.9 2.6 3.8 3.5 0.0 2.6 3.8 3.6 3.0 2.6 As4 3.0 2.1 3.8 3.3 2.3 3.2 Mid 20.0 16.0 24.5 22.5 12.0 17.5 Final Mark 42. 5 83.2 35.0 68.3 49.5 99.0 45.0 90.8 25.0 52.2 36.0 72.3 Options: A. Change a student grade B. Quit > 1 Enter the student number: > 301 Select: A. Lab B. Assignment C. Exam > B Enter the Assignment number followed by the new mark: > 2 40 The mark has been updated. As 3 3.2 2.3 ---Final Marks--- Student Labs Asl Buzz 777 8.2 3.5 Hamm 107 7.8 2.6 Jessie 123 10.0 3.8 Rex 666 9.2 3.8 Slinky 301 7.8 2.1 300 7.4 3.0 As2 2.9 2.6 3.8 3.5 3.0 2.6 3.8 As 4 3.0 2.1 3.8 3.3 2.3 3.2 Mid 20.0 16.0 24.5 22.5 12.0 17.5 Final Mark 42.5 83.2 35.0 68.3 49.5 99.0 45.0 90.8 25.0 55.2 36.0 72.3 3.6 3.0 2.6 Options: A. Change a student grade B. Quit > B *** End of program *** Write a program called CourseMarks that reads data from a file called Al.txt. The file contains a list of students and their name, student number, 11 lab marks, 4 assignment marks and 2 exam marks (midterm and final). Store each of the name, student number and marks in parallel arrays, where each array is related. Use 2D arrays for the lab, assignment and exam marks (i.e. a 2D array for each student's 11 lab marks, another for 4 assignment marks and a third for the 2 exam marks). Initial data: Name Final (100) 85 Buzz Hamm 32 Student# 777 107 123 666 301 300 Jessie 8 7 10 8 8 6 6 7 10 10 6 7 7 7 10 9 6 7 Labs (each out of 10) 9 10 8 9 8 9 9 8 8 8 10 10 10 10 10 9 10 7 9 8 9 9 7 0 7 7 6 8 9 8 7 7 10 9 10 7 Assignments Midterm (50) 0 46 38 42 40 40 0 34 35 30 28 10 50 50 50 50 10 50 46 8 28 8 40 10 8 10 10 8 7 Rex Slinky 40 30 Woody Individual components of the course are weighted as follows: - 10 labs: 10% of final mark (weighted evenly, best 10 of 11) - 4 labs: 15 % of final mark (weighted evenly) - Midterm exam: 25% of final mark - Final exam: 50% of final mark When the program runs, display the data summarized in the following format: Student Buzz Hamm Jessie Rex Slinky Woody # 777 107 123 666 301 300 Labs Asl 8.2 3.5 7.8 2.6 10.0 3.8 9.2 3.8 7.8 2.1 7.4 3.0 As2 2.9 2.6 3.8 3.5 0.0 2.6 As 3 3.2 2.3 3.8 3.6 3.0 2.6 As 4 3.0 2.1 3.8 3.3 2.3 3.2 Mid 20.0 16.0 24.5 22.5 12.0 17.5 Final Mark 42.5 83.2 35.0 68.3 49.5 99.0 45.0 90.8 25.0 52.2 36.0 72.3 Note that the Labs column contains the overall lab mark the student received out of 10 (the lowest mark is dropped). The assignments and exams are displayed with their respective weighting, and the total overall mark is displayed. The user will then be given an option to change a student's mark. The system prompts the user for the lab/assignment/exam to change, and the student number and new mark. The system confirms the change and displays the summary again. Include methods calculateWeightedMarks, displaySummary, and change Student Mark. Notes: . Use the size of the sample data for initializing array lengths - to format a double to 1 decimal place, use String.format("$.lf", value) . ArrayLists should not be used, but you may use other utilities from the Java Class Libraries. - Use auxiliary arrays as needed Sample output (text in blue is user input): As3 3.2 Hamm ---Final Marks--- Student Labs Asi Buzz 777 8.2 3.5 107 7.8 2.6 Jessie 123 10.0 3.8 Rex 666 9.2 3.8 Slinky 301 7.8 2.1 Woody 300 7.4 3.0 As 2 2.9 2.6 3.8 3.5 0.0 2.6 3.8 3.6 3.0 2.6 As4 3.0 2.1 3.8 3.3 2.3 3.2 Mid 20.0 16.0 24.5 22.5 12.0 17.5 Final Mark 42. 5 83.2 35.0 68.3 49.5 99.0 45.0 90.8 25.0 52.2 36.0 72.3 Options: A. Change a student grade B. Quit > 1 Enter the student number: > 301 Select: A. Lab B. Assignment C. Exam > B Enter the Assignment number followed by the new mark: > 2 40 The mark has been updated. As 3 3.2 2.3 ---Final Marks--- Student Labs Asl Buzz 777 8.2 3.5 Hamm 107 7.8 2.6 Jessie 123 10.0 3.8 Rex 666 9.2 3.8 Slinky 301 7.8 2.1 300 7.4 3.0 As2 2.9 2.6 3.8 3.5 3.0 2.6 3.8 As 4 3.0 2.1 3.8 3.3 2.3 3.2 Mid 20.0 16.0 24.5 22.5 12.0 17.5 Final Mark 42.5 83.2 35.0 68.3 49.5 99.0 45.0 90.8 25.0 55.2 36.0 72.3 3.6 3.0 2.6 Options: A. Change a student grade B. Quit > B *** End of program ***

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions