A class of 10 students has taken a test. Their marks are stored in an array Marks[1:10]. DECLARE Marks : ARRAY[1:10] OF INTEGER Marks ← {72, 85, 63, 91, 45,...

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

Question 1 Report

A class of 10 students has taken a test. Their marks are stored in an array Marks[1:10].

DECLARE Marks : ARRAY[1:10] OF INTEGER
Marks ← {72, 85, 63, 91, 45, 78, 56, 88, 70, 65}

(a) Write pseudocode to calculate and output the mean (average) mark. [3]

Answer Details

(a) To find the mean, sum all elements using a FOR loop and divide by the count: [3]

DECLARE Total : INTEGER
DECLARE Mean : REAL
DECLARE i : INTEGER
Total ← 0
FOR i ← 1 TO 10
    Total ← Total + Marks[i]
NEXT i
Mean ← Total / 10
OUTPUT "Mean mark: ", Mean

The marks are {72, 85, 63, 91, 45, 78, 56, 88, 70, 65}. Their sum is 72 + 85 + 63 + 91 + 45 + 78 + 56 + 88 + 70 + 65 = 713. The mean is 713 / 10 = 71.3. [1 mark for loop summing, 1 mark for division by 10, 1 mark for output]

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