Question 9
AQA Computer Science June 2025 Paper 1C (8525/1C)GCSE2 marks
On the specification
- 3.1 Fundamentals of algorithms3.2 Programming
Question text
9 Figure 9 shows five algorithms, represented using pseudo-code. box Figure 9 numbers [44, 1, 2, 14, 68] counter 0 total 0 WHILE counter < 5 A index counter total total + numbers[index] counter counter + 1 ENDWHILE OUTPUT total numbers [44, 1, 2, 14, 68] total 0 FOR a 0 TO LEN(numbers) - 1 B total total + numbers[a] ENDFOR OUTPUT total numbers [44, 1, 2, 14, 68] total 0 FOR a 1 TO 7 C total total + numbers[a] ENDFOR OUTPUT total numbers [44, 1, 2, 14, 68] total 0 WHILE total > 0 D total total + numbers[total] ENDWHILE OUTPUT total numbers [44, 1, 2, 14, 68] total 0 x 1 E REPEAT total total + numbers[x] UNTIL x = 5 OUTPUT total The algorithms in Figure 9 have been written to calculate the total of the five values box in the array numbers. Not all of the algorithms work. Complete the table by ticking () one box in each column (A–E). [2 marks] Algorithm A B C D E Algorithm totals the five values Algorithm does not total the five values 8