Skip to content
MathsGenie logo
Open app

Course home

  1. IGCSE
  2. Computer Science Edexcel
  3. Question bank

Constructs

EasyMedium
1234567891011121314
Question 2

A drone fleet monitoring system runs a program to check battery levels and alert operators. The pseudocode underneath is used for this process.

1 SET drones TO ["Alpha", "Beta", "Gamma", "Delta", "Epsilon", "Zeta", "Eta", "Theta"]
2
3 SET battery TO [0.85, 0.12, 0.60, 0.08, 0.05, 0.90, 0.45, 0.30]
4
5 SET i TO 0
6
7 WHILE i < 8 DO
8
9   IF (battery[i] < 0.1) THEN
10     SEND (drones[i] & " requires emergency landing") TO DISPLAY
11
12   ELSE
13     IF (battery[i] >= 0.3) AND (battery[i] <= 0.5) THEN
14       SEND (drones[i] & " requires charging") TO DISPLAY
15     END IF
16   END IF
17
18   SET i TO i + 1
19
20 END WHILE

The systems administrator wants to change the system so that any drone with a battery level of exactly 0.1 (10%) is also flagged as requiring an emergency landing. Currently, only drones with a battery level strictly less than 0.1 trigger this warning.

State how line 9 of the pseudocode must be changed to implement this amendment.

[1]

Constructs Questions

  1. IGCSE
  2. /Computer Science
  3. /Constructs