Task:
Write a program to grade a test and print the student’s score. The questions are in multiple choices form. There are 25 questions given in the test and each question has 4 choices; A,B,C and D. Assumed that there are 20 students taking the test. Each answer is stored in an array named answer as given below:
char answer [ ] = {“BACDACBDABBACADAABACABCDA”};
The student’s name, matrix number and the student’s answer is provided in a data file in the following format:
/* Matrix No Student’s answer */
11111 ABCDABCDABCDABCDABCDABCDA
11122 BBCCDDAABBCCDDAABBCCDDAAB
11133 AAAAABBBBBCCCCCDDDDDABCDA
For every correct answer, 4 marks will be given as a score and for every wrong answer, 1 mark will be deducted from the score.
Grade will be given base on the following scheme:
Marks/Grade
75 – 100 A
65 – 74 B
55 – 64 C
45 – 54 D
0 – 44 E
The output for the program is the name of the student, the matrix number, the score and the grade for each student.