An autonomous drone telemetry system validates a telemetry broadcast key using the following algorithm:
variable.length returns the number of characters in variable.
isValid = false
while (isValid == false)
broadcastKey = input("Enter the broadcast key: ")
if (broadcastKey.length >= 6) AND (broadcastKey.length <= 11)
isValid = true
print("Telemetry stream connected")
else
print("Connection rejected, invalid key length")
endif
endwhile
The algorithm needs testing to ensure the validation block (if-else statement) works correctly.
Identify two different pieces of test data that can be used to test different outputs of the algorithm. Give the expected output from the program for each piece of test data.
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.