Question 10

AQA Computer Science June 2023 Paper 1C (8525/1C)GCSE6 marks

On the specification

10.1
3.1 Fundamentals of algorithms3.2 Programming
10.2
3.2 Programming
Question text

10 Figure 9 shows an algorithm, represented in pseudo-code, used to display students’ box test scores. The algorithm does not work as expected and the teacher wants to find the error. The algorithm should display three test scores for each student: • Natalie has results of 78, 81 and 72 • Alex has results of 27, 51 and 54 • Roshana has results of 52, 55 and 59. • Line numbers are included but are not part of the algorithm. Figure 9 1 names  ['Natalie', 'Alex', 'Roshana'] 2 scores  [78, 81, 72, 27, 51, 54, 52, 55, 59] 3 count  0 4 FOR i  0 TO 2 5 person  names[i] 6 OUTPUT 'Student: ', person 7 FOR j  0 TO 1 8 OUTPUT j + 1 9 result  scores[i * 3 + j] 10 OUTPUT result 11 count  count + 1 12 ENDFOR 13 ENDFOR 10.1 Complete the trace table for the algorithm shown in Figure 9. You may not need to use all the rows in the table. [5 marks] count i person j result 10.2 How could the error in the algorithm in Figure 9 be corrected? box Shade one lozenge. [1 mark] A Change line number 3 to: count  -1 B Change line number 4 to: FOR i  1 TO 4 C Change line number 7 to: FOR j  0 TO 2 D Change line number 9 to: result  scores[j * 3 + i]