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.
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.