Skip to content

Course home

Boolean operations in a programming language

Boolean operations in a programming language

EasyMedium
123456789101112131415161718
Question 3

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

Figure 1

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.

[1]
Markscheme

Boolean operations in a programming language Questions

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

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.

Question bank