Defensive design
2
0/6

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]

Defensive design Questions

Practise OCR GCSE Computer Science Defensive design with exam-style questions for GCSE Computer Science. 14 questions, matched to the OCR GCSE Computer Science (J277) specification and written in Component 01 and Component 02 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.

PreviousNext

Defensive design Questions

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