14Easy
0/1

An algorithm is designed to manage the irrigation of a high-yield hydroponic greenhouse based on the measured ambient temperature and soil moisture levels.

Figure 1

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.

[1]

Boolean operations in a programming language Questions

Practise AQA GCSE Computer Science Boolean operations in a programming language with exam-style questions for GCSE Computer Science. 19 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.

PreviousNext

Boolean operations in a programming language Questions

  1. GCSE
  2. /Computer Science
  3. /Boolean operations in a programming language