Question: CODE IN JAVA STUDENTMARKS.txt Write a program called STUDENTMARKS that reads the data from the file StudentMarks.txt The file contains a list of students and
CODE IN JAVA


STUDENTMARKS.txt

Write a program called STUDENTMARKS that reads the data from the file StudentMarks.txt The file contains a list of students and their name, student number, 9 lab marks, 2 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 10 lab marks, another for 3 assignment marks, and a third for the 2 exam marks). Initial data: Assignments (out of 50) Midterm Final (50) (100) Name Labs (each out of10) Student# David 777 6 7 9 10 8 9 00 7 10 38 42 40 85 Kevin 107 7 7 7 9 9 00 00 8 7 8 35 30 32 70 Andrew 123 10 10 10 10 10 10 10 10 10 50 50 49 99 Lisa 666 10 9 9 10 7 9 8 9 10 46 48 45 90 Optimus 301 6 6 9 9 7 0 7 10 8 0 40 24 50 Autobots 300 7 7 7 6 8 9 8 7 7 35 35 35 72 Individual components of the course are weighted as follows: 8 labs: 10% of final mark (weighted evenly, best 8 of 9) 2 assignments: 15 % of final mark (weighted evenly) Midterm exam: 25% of final mark Final exam: 50% of final mark When the program runs, prompt the user to select one of the following options: 1. Display overall marks 2. Change student exam mark 3. Copy overall marks to a file 4. Quit Details: 1. Display overall marks Implement a method that calculates students' overall marks by applying the weight of each component. The method stores the marks in a new array and returns the new array. Implement a second method that displays the marks in the following format: Student # Mark David 777 74 Kevin 107 71 2. Change student exam mark Prompt the user to enter a student number. Prompt the user to enter the exam mark that must be changed as follows: 1. Midterm 2. Final Prompt the user to enter the new mark. Change the mark as well as the corresponding overall mark of the student. Display a message confirming that the change was successful. 3. Copy overall marks to a file Create two new parallel arrays of student numbers and overall marks, sorted in descending order of overall marks. Create a new text file where you copy on each row the student number and overall mark retrieved from the new sorted arrays. Prompt the user to enter a name for the file. You need to make sure that option 1 is selected before option 3. 4. Quit Program ends. 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. User may continue to select options until they quit (selection 4). System must check for valid input on menu selections, otherwise assume all other keyboard input is valid. ArrayLists should not be used, but you may use other utilities from the Java Class Libraries. David Kevin Andrew Lisa Optimus Autobots 777 107 123 666 301 300 6 7 9 10 8 9 8 7 10 7 7 9 9 8 8 8 7 8 10 10 10 10 10 10 10 10 10 10 9 9 10 7 9 8 9 10 6 6 9 9 7 0 7 10 8 777 6 8 9 8 7 7 38 42 35 30 50 50 46 48 0 40 35 35 40 32 49 45 24 35 85 70 99 90 50 72 Write a program called STUDENTMARKS that reads the data from the file StudentMarks.txt The file contains a list of students and their name, student number, 9 lab marks, 2 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 10 lab marks, another for 3 assignment marks, and a third for the 2 exam marks). Initial data: Assignments (out of 50) Midterm Final (50) (100) Name Labs (each out of10) Student# David 777 6 7 9 10 8 9 00 7 10 38 42 40 85 Kevin 107 7 7 7 9 9 00 00 8 7 8 35 30 32 70 Andrew 123 10 10 10 10 10 10 10 10 10 50 50 49 99 Lisa 666 10 9 9 10 7 9 8 9 10 46 48 45 90 Optimus 301 6 6 9 9 7 0 7 10 8 0 40 24 50 Autobots 300 7 7 7 6 8 9 8 7 7 35 35 35 72 Individual components of the course are weighted as follows: 8 labs: 10% of final mark (weighted evenly, best 8 of 9) 2 assignments: 15 % of final mark (weighted evenly) Midterm exam: 25% of final mark Final exam: 50% of final mark When the program runs, prompt the user to select one of the following options: 1. Display overall marks 2. Change student exam mark 3. Copy overall marks to a file 4. Quit Details: 1. Display overall marks Implement a method that calculates students' overall marks by applying the weight of each component. The method stores the marks in a new array and returns the new array. Implement a second method that displays the marks in the following format: Student # Mark David 777 74 Kevin 107 71 2. Change student exam mark Prompt the user to enter a student number. Prompt the user to enter the exam mark that must be changed as follows: 1. Midterm 2. Final Prompt the user to enter the new mark. Change the mark as well as the corresponding overall mark of the student. Display a message confirming that the change was successful. 3. Copy overall marks to a file Create two new parallel arrays of student numbers and overall marks, sorted in descending order of overall marks. Create a new text file where you copy on each row the student number and overall mark retrieved from the new sorted arrays. Prompt the user to enter a name for the file. You need to make sure that option 1 is selected before option 3. 4. Quit Program ends. 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. User may continue to select options until they quit (selection 4). System must check for valid input on menu selections, otherwise assume all other keyboard input is valid. ArrayLists should not be used, but you may use other utilities from the Java Class Libraries. David Kevin Andrew Lisa Optimus Autobots 777 107 123 666 301 300 6 7 9 10 8 9 8 7 10 7 7 9 9 8 8 8 7 8 10 10 10 10 10 10 10 10 10 10 9 9 10 7 9 8 9 10 6 6 9 9 7 0 7 10 8 777 6 8 9 8 7 7 38 42 35 30 50 50 46 48 0 40 35 35 40 32 49 45 24 35 85 70 99 90 50 72
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
