Skip to content

Course home

Programming concepts

Programming concepts

EasyMediumHard
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
Question 66

Drone Dispatch System

Figure 1 shows a grid representing a 3x3 landing zone system for a cargo drone delivery network.

Figure 1

KLM
1
2Drone
3

Figure 2 shows an incomplete Python program designed to validate the user's landing zone input.

Figure 2

isValid = False
while isValid == False:
    zone = ""
    while len(zone) != 2:
        zone = input("Enter landing zone (e.g. L2): ")
        zone = zone.upper()

Extend the program from Figure 2 so it completes the other checks needed to make sure a valid landing zone code is entered.

The landing zone code is valid if:

  • there are exactly two characters
  • the first character entered is K, L, or M
  • the second character entered is 1, 2, or 3

Your extended program must:

  • use the variable isValid
  • repeat the steps until a valid landing zone is entered
  • output an appropriate error message if the zone code entered is not valid

You should use indentation as appropriate, meaningful variable names, and correct Python syntax in your answer.

[6]
Markscheme

Programming concepts Questions

  1. GCSE
  2. /Computer Science
  3. /Programming concepts

298 exam-style questions on AQA GCSE Computer Science Programming concepts. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank