Skip to content

Course home

Defensive design

Defensive design

EasyMedium
12345678910
Question 2

When a drone launch sequence is initiated, the telemetry parameters are verified before takeoff. The program must validate the following criteria:

  • droneID must not be empty
  • mode must be either "manual" or "autonomous"
  • altitude must be between 150 and 500 (inclusive)

If any invalid data is found, "ABORT" is displayed. If all data is valid, "READY" is displayed.

Complete the program to validate the inputs.

You must use either:

  • OCR Exam Reference Language, or
  • a high-level programming language that you have studied (such as Python).
droneID = input("Enter drone ID: ")
mode = input("Enter flight mode: ")
altitude = input("Enter operational altitude in meters: ")
telemetryValid = False
[6]
Markscheme

Defensive design Questions

  1. GCSE
  2. /Computer Science
  3. /Defensive design

14 exam-style questions on OCR GCSE Computer Science Defensive design. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank