Data types

Easy
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
Question 27
Easy

State the most suitable data type for the variables soilpH and ventilationActive used in the algorithm below.

sensorReading ← USERINPUT
optimalRange ← USERINPUT
soilpH ← 6.5
ventilationActive ← False
statusReport ← "pH is within safe limits."

IF sensorReading < 5.5 THEN
    soilpH ← 5.2
    OUTPUT "Warning: Acidic soil!"
ELSE
    IF sensorReading > 7.5 THEN
        ventilationActive ← True
        soilpH ← sensorReading
    ELSE
        OUTPUT statusReport
    ENDIF
ENDIF
Variable identifierData type
soilpH
ventilationActive
[2]

Data types Questions

  1. GCSE
  2. /Computer Science
  3. /Data types