An algorithm is designed to control a smart home heating system.
Below is the pseudocode for this system:
1 temp ← GET_ROOM_TEMP()
2 mode ← 'idle'
3 IF temp < 18 THEN
4 mode ← 'heating'
5 ENDIF
6 WHILE mode = 'heating'
7 IF temp < 15 THEN
8 BOOST_BOILER()
9 ELSE
10 RUN_NORMAL()
11 ENDIF
12 temp ← GET_ROOM_TEMP()
13 ENDWHILE
Which line number shows where iteration is first used in this algorithm?
Line 3
Line 6
Line 7
Line 12
Practise AQA GCSE Computer Science Programming concepts with exam-style questions for GCSE Computer Science. 100 questions, matched to the AQA GCSE Computer Science (8525) specification and written in Paper 1 and Paper 2 style. Every question includes a full worked solution and mark scheme, so you can see where marks are awarded rather than just whether you got the answer right.