An automated greenhouse irrigation system uses an algorithm, represented in pseudo-code, to determine the misting duration for various crops based on humidity levels.
humidityLevel ← USERINPUT
cropType ← USERINPUT
mistDuration ← 0
errCodeA ← "Sensor Error"
errCodeB ← "Unsupported Crop"
IF humidityLevel <= 65.5 AND cropType != "None" THEN
IF cropType == "Fern" THEN
mistDuration ← 120
OUTPUT mistDuration
ELSE IF cropType == "Succulent" THEN
mistDuration ← 15
OUTPUT mistDuration
ELSE
OUTPUT errCodeB
ENDIF
ELSE
OUTPUT errCodeA
ENDIF
State how many possible values the result of the comparison humidityLevel <= 65.5 could have in the algorithm shown in Figure 1.
Practise AQA GCSE Computer Science Boolean logic with exam-style questions for GCSE Computer Science. 83 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.