Question: QUESTION 2 Write a complete C++ program to grade an exam. The exam consists of 7 short answer questions. Each question has one answer. The


QUESTION 2 Write a complete C++ program to grade an exam. The exam consists of 7 short answer questions. Each question has one answer. The program will read in the students' answers and the correct answers from files and prints out the result onto the file output. The number of student is unknown but not more than 40. The students' answers are stored in a data file named "Student Answers.txt" as shown in Figure 2.1. In this file, the first column represents the students' name (I word), second column represent the students' ID and the third column until the last column represent the students' answer of question I until question 7. In this example (Figure 2.1), there are only four students. You have to complete this input file with data at least for & students and cover all situations. The correct answers for all the questions are stored in a text file named "Correct Answers.txt" as shown in Figure 2.2 The program needs to satisfy the following requirements a. Compare the student's answers and the correct answers. If round of the student's answer is equal to the round of the correct answer, the student's answer is acceptable. For example, the correct answer is 54.2 and the student's answer is 53.8, round of both answers is 54, so the student's answer is correct. x 100 b. Calculate and display the percentage of questions answered correctly. This can be calculated as: correctly answered questions percentage = total number of questions c. Display the grade of the students based on the percentage as follows: 80 percentage S 100-grade is A .65 5 percentage
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
