Question 8

AQA Computer Science June 2025 Paper 1B (8525/1B)GCSE6 marks

On the specification

8.1
3.1 Fundamentals of algorithms3.2 Programming3.4 Computer systems
8.2
3.2 Programming
Question text

8 Figure 8 shows an algorithm represented using pseudo-code. box • Line numbers are included but are not part of the algorithm. Figure 8 1 b1  '0010' 2 b2  '0111' 3 new  '' 4 FOR i  0 TO LEN(b1) - 1 5 IF b1[i] = '1' OR b2[i] = '1' THEN 6 IF NOT (b1[i] = '1' AND b2[i] = '1') THEN 7 new  new + '1' 8 ELSE 9 new  new + '0' 10 ENDIF 11 ELSE 12 new  new + '0' 13 ENDIF 14 ENDFOR 15 OUTPUT new 8.1 Complete the trace table for the algorithm shown in Figure 8. You may not need to use all the rows in the table. [5 marks] b1 b2 new i 8.2 Explain why line 4 in Figure 8 uses LEN(b1) - 1 instead of LEN(b1) box [1 mark]