An algorithm is designed to manage the irrigation of a high-yield hydroponic greenhouse based on the measured ambient temperature and soil moisture levels.
ambientTemp ← USERINPUT
soilMoisture ← USERINPUT
waterVolume ← 0.0
msgInhibited ← "Irrigation inhibited"
msgTooCold ← "Temperature below freezing threshold"
IF ambientTemp > 5.0 AND soilMoisture < 80.0 THEN
IF soilMoisture < 30.0 THEN
waterVolume ← 15.0
OUTPUT waterVolume
ELSE IF soilMoisture < 60.0 THEN
waterVolume ← 8.0
OUTPUT waterVolume
ELSE
OUTPUT msgInhibited
ENDIF
ELSE
OUTPUT msgTooCold
ENDIF
State how many possible values the result of the comparison ambientTemp > 5.0 could evaluate to in the algorithm shown in Figure 1.
19 exam-style questions on AQA GCSE Computer Science Boolean operations in a programming language. Each one has a worked solution and a mark scheme showing where the marks go.