An algorithm is designed to monitor an automated greenhouse's weekly crop yields:
1 total_yield ← 0
2 days ← 1
3 IF sensor_active = True THEN
4 WHILE days ≤ 7 AND total_yield < 500
5 daily_harvest ← READ_INPUT()
6 IF daily_harvest > 100 THEN
7 total_yield ← total_yield + daily_harvest
8 ELSE
9 FOR k ← 1 TO 2
10 SEND_ALERT("Low Yield")
11 ENDFOR
12 ENDIF
13 days ← days + 1
14 ENDWHILE
15 ENDIF
Where is iteration first used in this algorithm?
Line 3
Line 4
Line 6
Line 9
208 exam-style questions on AQA GCSE Computer Science Representing algorithms. Each one has a worked solution and a mark scheme showing where the marks go.