Question: You have been hired under a student working scheme program. Your first task is to write a C program to assist in one of the



You have been hired under a student working scheme program. Your first task is to write a C program to assist in one of the professors in the faculty to grade the final exam of his/her students. The exam consists of 20 multiple-choice questions. Each question has one of four possible answers: A, B, C, or D. The program will read in the student answers and the correct answers from files and prints out the result onto the screen. It only handles a student for each run. Thus, the program needs to be executed several times for multiple students. The details for program requirements are as follow: Input The correct answers for all the questions are stored in a text file named Correct Answers.txt", whereas the student answers are stored in a text file named StudentAnswer01.txt. For the student answer file, the first line represents the student's name, the second line represent the student's ID. The remaining lines contain the answers stored accordingly, the third line contains the answer to the first question, the fourth line contains the answer to the second question, and so forth as shown in Figure 1. The correct answers file contains the answer of 20 questions as shown in Figure 2. Output The program needs to determine and print out the following: o The name and ID of the student. o The total number of question missed by the student. o The list of the questions missed by the students, showing the correct answers and the incorrect answers by the student for each missed question. The percentage of questions answered correctly. This can be calculated as: correctly answered questions percentage = x 100 total number of questions If the percentage of correctly answered is 50% or greater, the program should indicate that the student passed the exam. Otherwise, it should indicate that the student failed the exam. 8 o Figure 3 shows example runs of the program Array The program should use array(s) to store the answers. B D A D NURHIDAYAH ALI ACI2C56789 B D A D B B D B A A B D Figure 1: Students answers file EXAM RESULT Name NURHIDAYAH ALI Student ID AC12CS6789 Number of questions missed: 4 List of the questions missed: Question Correct Answer Student Answer 2 A 11 B A 14 B 18 Percentage: 80%: Passed the exam A B A D B B A A A B D Figure 2: Correct answers file Figure 3: Example run of the program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
