C++ Code An instructor at the university needs your help. He has a file with the
ID: 3667801 • Letter: C
Question
C++ Code An instructor at the university needs your help. He has a file with the students’ ID, assignments, exam1, exam2 and final exam. You need to implement a program to take this file and generate a new file with percentage score for each student after exam2 (consisting of the assignments, exam 1, and exam 2) for the instructor record in the middle of the semester, percentage score for each student after final exam, and the final grade of each student. Your file should output how many A’s and B’s in the class. You will use separate compilation where you will have 3 files (header file, implementation file and the main function) Development notes: 1- Define class TermGrade which will include different functions to get the percentage after exam 2, percentage after final exam, and the overall grade of each student. Also this class will define the variables needed in implementing the program. It will need the following methods: ReadData(istream& in). This reads the ID number and scores (one line of data) from the file. It returns true if the attempt to read data was successful, false otherwise. MidsemseterScore(). It returns the average of the assignments and first two exams. It returns a double. (Beware of integer division: 89/3 = 29; 89/3.0 = 29.66666667). This is a const method. FinalScore(). This returns the average of all grade components, as a double. This is a const method. LetterGrade(). This method returns ‘A’, ‘B’, ‘C’, ‘D’, or ‘F’ (character values). This is a const method. 2- Input data from grade1.txt and output data to finalgrade.txt. 3- Add menu to the instructor to choose (1- percent after exam 2, 2- percent after final exam, 3- all the above). 4- Assignments weight 20%, Exam1 weight 25%, Exam2 weight 25%, and Final exam weight 30%. 5- Calculate % after Exam 2 period, and after the final exam. 6- Include grade of students, grade depends on the final score percentage: - A: Final percentage greater than or equal 90 - B: Final percentage between 80 and 90. - C: Final percentage between 70 and 80. - D: For other percentages. Implementation details: Your program will have 3 source files: a header file and implementation file for the class, and a main program that #includes the class file and uses it. Use appropriate functional decomposition in your main program.