An algorithm is designed to manage the safety parameters of an autonomous drone flight controller, based on its current altitude (in metres) and detected wind speed (in km/h).
droneAltitude ← USERINPUT
windSpeed ← USERINPUT
flightStatus ← "STABLE"
msgDanger ← "Aborting flight: High wind"
msgLowAltitude ← "Warning: Altitude too low"
IF droneAltitude >= 50 AND windSpeed < 30 THEN
IF windSpeed < 15 THEN
flightStatus ← "OPTIMAL"
OUTPUT flightStatus
ELSE IF windSpeed < 25 THEN
flightStatus ← "CAUTION"
OUTPUT flightStatus
ELSE
OUTPUT msgDanger
ENDIF
ELSE
OUTPUT msgLowAltitude
ENDIF
State how many possible values the result of the comparison droneAltitude >= 50 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.