Question: Write the program that allows users to enter the file name to store the information of students then provides the menu to allow users to

Write the program that allows users to enter the file name to store the information of students then provides the menu to allow users to select the following tasks and only terminate the program when users select exit Each task has to be handle in a user-defined function GRADING STUDENTS 1. Enter Information of Students in class 2. Enter the scores of Students 3. Grading 0. Exit TASK 1: ENTER INFORMATION OF STUDENTS IN CLASS -Open the file with the above file name as output file -Read information of one student that includes: student id, last name, first name, phone then create the object of class Student to have all information that need for one student. One student should hold the following information: Id, last name, first name, phone, list of quizzes scores, list of homework scores, list of labs scores, list of test scores, project score, discusssion score, team work score, extra credit scores, total score, percentage and letter grade. -Store the information of this student by writing one line to the above output file with following format: id,lastname,firstname,phone-list of quizzes scores-list of homeworks scores-list of labs scores-list of tests scores- project score-discussion score-team work score-extra credit score-total score-percentage-letter grade For example: 1234567,Smith,James,4691234567-0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0-0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0-0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0-0.0, 0.0, 0.0-0.0-0.0-0.0-0.0-0.0-X Where: Quizzes scores: first 14 numbers 0.0 Homework scores: second 10 numbers 0.0 Lab scores: third 7 numbers 0.0 Test scores: fourth 3 numbers 0.0 Project: 0.0 Discussion: 0.0 Team work: 0.0 Extra credit: 0.0 Total score: 0.0 Percentage: 0.0 Letter grade: X The program should allow users to continue to enter the information of other students until they want to stop TASK2: READ THE SCORES -open the above file to read (input file) -open a file tempFile.txt to write (output file) -read input file: ? for each line: -Display the student id with the message to tell users to enter the scores of the student with that student id -Display message to ask users to enter the scores of quizzes, the scores separate by space. Read the scores. If there is only one score, store it to a float variable. If there are more than one scores of an assignment type, store the list of scores to a float array -Continue ask for entering the scores of homeworks, labs, tests, project, discussion, team work, and extra credit For example for read scores of quizzes as below: Enter the scores of quizzes separate by space: 2.5 3.5 4.0 5.0 3.25 4.5 3.5 5.0 5.0 4.25 2.5 2.5 5.0 5.0?store to array quizzes The size of arrays should be: Quizzes: 14 Homeworks 10 Labs: 7 Tests: 3 Project 1 Discussion 1 Team work 1 Extra credit 1 Max score: 5 Max score: 10 Max score: 30 Max score: 100 Max score: 80 Max score: 20 Max score: 20 Max score: 5 Total: 70 Total: 100 Total: 210 Total: 300 Total: 80 Total: 20 Total 20 Total scores: 800 (not include extra credit) -After finishing the scores of one student, you should combines all information and scores in to one String in the following format. * The information of the student (id, last name, first name, phone) separate by comma * the scores of the same assignment type separate by comma * The list of informtion, the list of scores of different assignment type separate by dash All information are separated by comma. Information and other type of assignments are separated by dash. For example: The information and scores of student James Smith will be combined in one string as below: 1234567,Smith,James,4691234567-2.50,3.50,4.00,5.00,3.25,4.50,3.50,5.00,5.00,4.25,2.50,2.50,5.00,5.00- 8.50,9.00,10.00,8.50,9.25,7.50,6.75,8.00,9.00,10.00-30.00,38.50,29.25,23.50,25.00,22.50,28.00-88.50,75.50,78.50-75.50-10.00-20.00-5.00-0.00- 0.00-X -Write this string to the output file tempFile.txt ? read next line from input file then do the same until the end of the input file ? at the end of this task2 do the following lines of code: + close input file + close output file (file tempFile.txt) + delete input file + rename file tempFile.txt to the same name with input file ifile.close(); ofile.close(); file.delete();// input file delete temp.renameTo(file); //rename tempFile to input file name TASK3: GRADING -open the above file to read (input file) -open a file tempFile.txt to write (output file) -read file: ? read one line from the input file that should be in the following format: 1234567,Smith,James,4691234567-2.50,3.50,4.00,5.00,3.25,4.50,3.50,5.00,5.00,4.25,2.50,2.50,5.00,5.00- 8.50,9.00,10.00,8.50,9.25,7.50,6.75,8.00,9.00,10.00-30.00,38.50,29.25,23.50,25.00,22.50,28.00-88.50,75.50,78.50-75.50-10.00-20.00- 5.00-0.00-0.00-X -split information from the line by using delimeter comma (,) or dash (-); then assign each piece of information to the following For example the line is read from file: 1234567,Smith,James,4691234567-2.50,3.50,4.00,5.00,3.25,4.50,3.50,5.00,5.00,4.25,2.50,2.50,5.00,5.00- 8.50,9.00,10.00,8.50,9.25,7.50,6.75,8.00,9.00,10.00-30.00,38.50,29.25,23.50,25.00,22.50,28.00-88.50,75.50,78.50-75.50-10.00-20.00- 5.00-0.00-0.00-X Will be splitted into: Id = 1234567 Last name = Smith First name = James Phone = 4691234567 Quizzes = 2.50,3.50,4.00,5.00,3.25,4.50,3.50,5.00,5.00,4.25,2.50,2.50,5.00,5.00 Homeworks = 8.50,9.00,10.00,8.50,9.25,7.50,6.75,8.00,9.00,10.00 Labs = 30.00,38.50,29.25,23.50,25.00,22.50,28.00 Tests = 88.50,75.50,78.50 Project = 75.50 Discussion = 10.00 Team work = 20.00 Extra credit = 5.00 Sum of score = 0.00 Percentage = 0.00 Letter grade = X //these scores are stored in array //these scores are stored in array //these scores are stored in array //these scores are stored in array -After calculate the percentage and determine the letter grade, you combine all the information and scores and result to one string as you did in Task2 -Write the string to the output file tempFile.txt -Read another line the do the same until the end of input file ? After finishing all students do the same thing as task2 to rename the tempFile.txt back to orignial input file ? Also, display the result of class on the screen in the following format; GRADING CLASS Total students: Grade A: Grade B: Grade C: Grade D: Grade F: 20 5 25% 10 50% 4 20% 0 0% 1 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!