An algorithm has been developed to automate an irrigation system in a greenhouse based on the daily weather forecast.
1 forecast ← USERINPUT
2 IF forecast = 'overcast' THEN
3 pulses ← 2
4 ELSE IF forecast = 'warm' THEN
5 pulses ← 5
6 ELSE IF forecast = 'hot' THEN
7 pulses ← 8
8 ELSE
9 OUTPUT 'unknown weather'
10 ENDIF
11 FOR i ← 1 TO pulses
12 IF i <= 3 THEN
13 TRIGGER_MIST('fine')
14 ELSE
15 TRIGGER_MIST('heavy')
16 ENDIF
17 ENDFOR
State how many times the subroutine TRIGGER_MIST will be called with the parameter 'fine' if the user input is 'warm'.
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.