Answered step by step
Verified Expert Solution
Question
1 Approved Answer
CODE IN JAVA A1.txt Buzz 777 8 6 7 9 10 8 9 8 7 10 0 46 38 42 40 40 85 Hamm 107
CODE IN JAVA
A1.txt
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
Write a program called CourseMarks that reads data from a file called A1.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 Buzz 8 7 Assignments Student# Labs (each out of 10) (out of 50) 777 6 9 10 8 9 8 7 10 0 46 38 42 40 107 7 7 7 9 9 8 8 8 7 8 34 35 30 28 123 10 10 10 10 10 10 10 10 10 10 10 50 50 50 50 666 8 10 9 9 10 7 9 8 9 10 10 50 46 48 44 301 8 6 6 9 9 7 0 7 10 8 8 28 0 40 30 300 6 7 7 7 6 8 9 8 7 7 8 40 35 35 42 Midterm Final (50) (100) 40 85 32 70 49 99 Hamm 10 10 10 10 45 90 Jessie Rex Slinky Woody 24 50 72 0 8 35 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: Labs As3 Mark 777 Student Buzz Hamm Jessie Rex Slinky Woody 8.2 7.8 10.0 9.2 As1 3.5 2.6 3.8 3.8 2.1 3.0 As2 2.9 2.6 3.8 107 123 666 301 300 As 4 3.0 2.1 3.8 3.2 2.3 3.8 3.6 3.0 2.6 Mid 20.0 16.0 24.5 22.5 12.0 17.5 Final 42.5 35.0 49.5 45.0 25.0 36.0 83.2 68.3 99.0 90.8 52.2 72.3 3.5 7.8 0.0 3.3 2.3 3.2 7.4 2.6 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 changeStudentMark. Notes: Use the size of the sample data for initializing array lengths to format a double to 1 decimal place, use String.format("%.18", 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): As1 As2 777 ---Final Marks--- Student # Labs Buzz 8.2 Hamm 107 7.8 Jessie 123 10.0 Rex 666 9.2 Slinky 301 7.8 Woody 300 7.4 3.5 2.6 3.8 3.8 2.1 2.9 2.6 3.8 3.5 0.0 2.6 As3 3.2 2.3 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 42.5 35.0 49.5 45.0 25.0 36.0 Mark 83.2 68.3 99.0 90.8 52.2 72.3 3.0 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. ---Final Marks--- Student # Labs As1 As2 As3 As 4 Mid Final Mark Buzz 777 8.2 3.5 3.2 3.0 20.0 42.5 83.2 Hamm 107 7.8 2.6 2.3 2.1 16.0 35.0 68.3 Jessie 10.0 3.8 3.8 3.8 24.5 49.5 123 666 2.9 2.6 3.8 3.5 3.0 2.6 9.2 3.8 22.5 45.0 Rex Slinky Woody 3.6 3.0 3.3 2.3 99.0 90.8 55.2 301 7.8 2.1 12.0 25.0 300 7.4 3.0 2.6 3.2 17.5 36.0 72.3 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
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