Skip to content

Course home

Testing

Testing

EasyMedium
123456789101112131415161718
Question 6

A drone operations hub is writing an algorithm to validate the callsigns of commercial drones registering for flight space (for example, "DRONE7").

variable.length returns the number of characters in variable.
variable.lower returns the characters in variable in lower case.

    valid = false

    while (valid == false)

        callsign = input("Enter callsign: ")

        if (callsign.length >= 5) AND (callsign.length <= 12)

            registeredCallsign = callsign.lower

            valid = true

            print("Callsign registered")

        else

            print("Invalid callsign format")

        endif

    endwhile

The algorithm needs testing to ensure the decision block (if-else statement) behaves correctly.

Identify two different pieces of test data that can be used to test different outputs of the algorithm. Give the output from the program for each piece of test data.

[4]
Markscheme

Testing Questions

  1. GCSE
  2. /Computer Science
  3. /Testing

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

Question bank