Question 6(c) 2025 · February-March · Paper 22 · 4 marks
Reveal official mark-scheme answer
Official answer for Question 6
Part (c)
Question 4
Show text version of question
Question 6
Part (c)
Question 6
This pseudocode algorithm is intended to allow 1000 positive integers to be input and stored in
a one-dimensional (1D) array. The integers are added together as they are input and the highest value is identified. At the end of the algorithm, the highest number, the total and the average of the numbers are output.
01 DECLARE Numbers : ARRAY[1:1000] OF INTEGER 02 DECLARE Highest : STRING 03 DECLARE Count : INTEGER 04 DECLARE Total : INTEGER 05 Highest ← 1500 06 Total 0 ← ← 07 FOR Count 1 TO 1000 08 INPUT Numbers[Count] 09 Total ← Total + Count 10 IF Numbers[Count] > Total 11 THEN 12 Highest Numbers[Count] ← 13 ENDIF 14 NEXT Count 15 OUTPUT "The highest number is ", Highest 16 OUTPUT "The total is ", Total 17 OUTPUT "The average is ", Average / 1000
Part (c)
Explain how you could change the corrected algorithm so that it also finds the smallest
number that was input and outputs its value at the end.
Any code used must be fully explained.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................
Question 6
, ,
Why this question appears here
99% assigned-topic match · Programming › Programming concepts
Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.
Permanent source page: Educate A Change · From 0478_m25_qp_22.pdf
