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.
30 exam-style questions on AQA GCSE Computer Science Boolean logic. Each one has a worked solution and a mark scheme showing where the marks go.