Question 6(b) 2025 · February-March · Paper 22 · 2 marks
Reveal official mark-scheme answer
Official answer for Question 6
Part (b)
Question 2
Show text version of question
Question 6
Part (b)
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 (b)
Write the pseudocode statement to output the average of the numbers, rounded to two
decimal places.
...................................................................................................................................................
.............................................................................................................................................
Why this question appears here
98% assigned-topic match · Programming › Arrays
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
