May/June 2026 Paper 21

2026 · 12 questions · 20 parts · 75 marks

0/75 marks
0Correct0Partial0Wrong20Unattempted
Filters0 active

Questions

Select a part to jump to its question

Finish set
Q1–/1 mk
Q2–/4 mks
Q3–/3 mks
Q4–/4 mks
Q6–/4 mks
Q7–/4 mks
Q8–/7 mks
Q10–/9 mks
Q11–/5 mks
Q12–/15 mks
7Testing DebuggingMedium4 marks
An algorithm has been written in pseudocode for a user to repeatedly input positive whole numbers and store them in an array called Values[] until is input or until the array is full. The algorithm outputs the average of the numbers to 2 decimal places.
pseudocode
DECLARE Counter : INTEGERDECLARE Total : INTEGERDECLARE Average : INTEGERDECLARE Values : ARRAY[1:100] OF INTEGERCounter ← 1Total ← 0OUTPUT "Please enter a positive whole number or -1 "INPUT NumberWHILE Number = -1 AND Counter <= 100 DO    Values[Counter] ← Number    Total ← Total + 1    Counter ← Counter + 1    INPUT NumberENDWHILECounter ← Counter - 1Average ← Counter / TotalOUTPUT "The average is ", ROUND(Average, 2)
Identify the line numbers of four errors in the pseudocode and suggest a correction for each error.

Answer

0 words