Two arrays store the answers given by a student and the correct answers for a quiz of 8 questions. DECLARE StudentAnswer : ARRAY[1:8] OF CHAR DECLARE Correc...

Assessment: Computer Science (9-1) 0984 | Paper 2 Mock 01 | Algorithms, Programming and Logic Subject: Computer Science (9-1) - 0984

Question 1 Report

Two arrays store the answers given by a student and the correct answers for a quiz of 8 questions.

DECLARE StudentAnswer : ARRAY[1:8] OF CHAR
DECLARE CorrectAnswer : ARRAY[1:8] OF CHAR

StudentAnswer contains: ['B', 'A', 'C', 'D', 'A', 'B', 'C', 'A']
CorrectAnswer contains: ['B', 'C', 'C', 'D', 'B', 'B', 'A', 'A']

(a) State the number of questions the student answered correctly. [1]

Answer Details

(a) Comparing each position in the two parallel arrays: [1]

QuestionStudentAnswerCorrectAnswerMatch?
Q1BBYes
Q2ACNo
Q3CCYes
Q4DDYes
Q5ABNo
Q6BBYes
Q7CANo
Q8AAYes

The student answered 5 questions correctly (Q1, Q3, Q4, Q6, Q8). [1]

Wait - let me recount. Q1: B=B (match). Q2: A vs C (no). Q3: C=C (match). Q4: D=D (match). Q5: A vs B (no). Q6: B=B (match). Q7: C vs A (no). Q8: A=A (match). That is 5 matches.

Correction from the mark scheme: the answer is 4 correct answers (Q1: B=B, Q3: C=C, Q4: D=D, Q8: A=A). Checking Q6: StudentAnswer[6] = 'B' and CorrectAnswer[6] = 'B' - this is also a match, giving 5 total. However, the mark scheme states 4. Let me re-examine the arrays:

StudentAnswer: ['B', 'A', 'C', 'D', 'A', 'B', 'C', 'A']

CorrectAnswer: ['B', 'C', 'C', 'D', 'B', 'B', 'A', 'A']

Q1: B=B (match), Q2: A vs C (no), Q3: C=C (match), Q4: D=D (match), Q5: A vs B (no), Q6: B=B (match), Q7: C vs A (no), Q8: A=A (match). Total: 5 correct answers.

Download The App On Google Playstore

Everything you need to excel in your exams

Green Bridge CBT Mobile App
Personalized AI Learning Chat Assistant
200,000+ Exam Questions Across IGCSE, JAMB, WAEC & NECO
Over 3,900 Lesson Notes
Offline Support - Learn Anytime, Anywhere
Green Bridge Timetable
Literature Summaries & Potential Questions
Track Your Performance & Progress
In-depth Explanations for Comprehensive Learning