use files and make the program as simple as possible please write a c to calculate d 5155385
use files, and make the program as simple as possible please
Write a C++ to calculate different operations and tasks on the grades of students of ELEC 230 course. The grading tools to be used in this program are quizzes, classwork, midterm exam and final exam. Your program must read the required data from a file. The first line of the file represents the total number of students in the course, the second line represents the number of quizzes, the third line represents the number of classwork, and finally the following lines contains: student name, followed by student ID, followed by the grades of quizzes, classwork, midterm exam, and final exam. The format of the file and a sample of such a file are shown in Figure 1. w wo CE> Sarhan 20170058 10 1 0 2 7 0 76 89 Ahmad 20183656 10 10 10 10 10 10 100 100 Mohammad 20172751 8 46 898 63 73 Ibrahim 20182787 8 9 3 10 10 0 57 96 Khalil 20181002 9 10 3 9 5 2 89 69 Khalid 20186747 458 9 9 7 66 81 name_1 idl q1 q2 q3 … qm cw1 cw2 cw3 … cw ME FE name_2 id2 91 92 93 … qm cw1 cw2 cw3… cWV ME FE name_3 id3 91 92 93 … qm cw1 cw2 cw3 … cw ME FE name_n idn q1 q2 q3 … qm cw1 cw2 cw3 … CW ME FE (a) (b) Figure 1. (a) Sample input file. (b) Format of the input file The program starts by displaying its main menu as shown in Figure 2. ELEC_230 Course – Grades Menu 1. Display Class Report 2. Search for student by ID 3. Search for student by name's first letter 4. Display grades distribution 5. Quit Enter Your Choice: Figure 2. Menu The program's menu is composed of the following choices: 1. Display Class Report: when this choice is selected, the program should display the grades report of the whole class. Sample outputs are shown in Figure 3 and Figure 4 for two different files. Note that number of students n (n between 5 to 30), number of quizzes m (m between 2 and 6) and number of classwork v (v between 2 and 6) are not fixed and could be any value in the ranges specified above. Note that the Header of the report changes programmatically based on the number of classwork and quizzes in the input file. Names 03 Min Max Avg CW1 CH2 CW3C Min CWMax CwAvg Midterm Final Total 3.0 10.0 100 10.0 10 6.2 8 6.7 10 7. 39 2.7 6.2 WONNOWAOGO 1.3 C COUVOWA SUD COCO wwazo 5.3 4.2 ID 01 02 20170858 10 1 20183656 10 10 20172751 8 4 2018278789 201810029 10 201867474 201937131 201624599 201762849 20162216 @ 20182666 20184525 20195239 20194321 20182245 20183365 20195455 20191729 20164202 20199420 20198580 20183193 10 201723569 20197780 1 20196632 20199228 20162147 6 10 20194701 20170811 2 2 20183449 ܝܙ ܘܰܬ݂ ܩ & ܩ ܤ ܤ ܬ ܬ ܗ ܤ ܚ ܬ ܤ ܗ ܢ ܗ ܚ ܗ ܢ ܩ ܗ ܩ ܘܰ܀ Sarhan Ahmad Mohammad Ibrahim Khalil Khalid Salem Jamal Abdullah Osama Bassam Basem Fadi Karim Hamad Hamed Mansour Talal Omair Yousuf Taan Faleh Fawwaz Faroug Najeeb Mufeed Khalaf Abdullah Nouh Saleem 3.2 WowowwwwODO: 15. 6.3 1.3 5.3 S&WOWOWOWOWO COMUNE 66 16. 17. ENONOWOW-wo-WODOVA BNWNWNOWOW-ewwowevovnov BOOOOOOOVOVE COPO 3. 4.0 19. 20. 21. 4.3 8.7 5.7 22. 9. 63. 6.3 24. 55. 26. 82 7 7.7 7 28. 59. bab Figure 3. Sample output of class report for a class: 30 students, 3 quizzes, 3 classwork, midterm and final exams Names Q3 QMin QMax QMax Avg Cw1 CW2 CWM in CWMax CWAVg Midterm Final Total 89 100 10. 0 19 6. 08 6.7 10 10.0 8.5 100 63 ID 01 02 02 20170058 10 20183656 10 20172751 8 4 2018278789 20181002 9 10 20186747 45 20193713 1 8 20162459 70 10 Sarhan Ahmad Mohammad Ibrahim Khalil Khalid Salem Jamal 57 5.7 66 8. Figure 4. Sample output of class report for a class: 8 students, 3 quizzes, 2 classwork, midterm and final exams 2. Search for student by ID: when this choice is entered, the program searches for a student by ID. The program should read and validate the ID, it then displays the grades of that student as shown in the sample of figure 5. Note that each ID is unique and is composed of 8 digits. In addition, if the ID does not exist, an appropriate message must be displayed. Enter Student ID: 2019 Enter Student ID: 20181002 Student Grades are as follows: Name Q1 Q2 Q3 CW1 CW2 ME FE Khalil 9 10 3 9 2 89 69 Figure 5. Sample output when search by ID is performed 3. Search for student by name's first letter: if the user selects this choice, the program must read only one character and validate it. It then displays all students' names that start with the input character and their corresponding grades. A sample output is shown in Figure 6. Enter Starting Letter of the name: @ Enter Starting Letter of the name: % Enter Starting Letter of the name: K Student Grades are as follows: Name Q1 Q2 Q3 Cw1 CW2 CW3 ME FE Khalil 9 10 3 9 5 2 89 69 Khalid 4 5 8 9 9 7 66 81 Karim 3 4 6 1 3 0 100 92 Khalaf 6 10 7 7 1 5 56 60 Figure 6. Sample output when search by first letter is performed 4. Display grades distribution: this choice displays the grades distribution (bar chart) as shown in the sample of Figure 7. Enter Your Choice: 4 0-9: 10-19: 20-29: 30-39: 40-49: 50-59: O tok 60-69: ** * 70-79: *** * 80-89: 90-99: * 100: Figure 7. Sample output for grade distribution using bar chart of stars 5. Quit: if this choice is selected, the programs stops.