An algorithm is shown below:
1 SET readings TO [12, 15, 14, 18, 20, 22, 19, 17]
2 SET filtered TO []
3
4 FOR index FROM 0 TO (LENGTH (readings) - 1) STEP 2 DO
5 APPEND readings[index] TO filtered
6 END FOR
Describe what happens to the variable index when line 4 is executed.
18 exam-style questions on Edexcel IGCSE Computer Science Constructs. Each one has a worked solution and a mark scheme showing where the marks go.