Question 8
AQA Computer Science June 2024 Paper 1A (8525/1A)GCSE6 marks
On the specification
- 3.1 Fundamentals of algorithms3.2 Programming
Question text
8 Figure 6 shows an algorithm, represented using pseudo-code. box Figure 6 days [10, 15, 4] sales [20, 33, 12] weeks [0, 0, 0] FOR i 0 TO 2 daysTotal days[i] + sales[i] weeks[i] daysTotal DIV 7 ENDFOR weeksTotal weeks[0] + weeks[1] + weeks[2] OUTPUT weeksTotal The DIV operator is used for integer division. Complete the trace table for the algorithm in Figure 6. Part of the table has already been filled in. You may not need to use all the rows in the table. [6 marks] weeks i daysTotal weeksTotal [0] [1] [2] 0 0