An algorithm designed to monitor space exploration equipment is shown in the following code block:
1 # ==========================================
2 # Remote telemetry monitor
3 # ==========================================
4 deepSpaceProbes = ["Voyager 1", "Voyager 2", "New Horizons", "Pioneer 10"]
5 activeProbe = ""
6
7 # ------------------------------------------
8 # Diagnostics sequence
9 # ------------------------------------------
10
11 for probe in deepSpaceProbes:
12 print("Checking status of: " + probe)
13
14 activeProbe = input("Enter probe identifier: ")
15 while (activeProbe != "QUIT"):
16 if (activeProbe == "Voyager 1"):
17 print("Voyager 1 is in interstellar space!")
18 else:
19 print("Pinging telemetry receiver for " + activeProbe)
20
21 activeProbe = input("Enter next probe identifier: ")
State the line number where the algorithm first begins to iterate over every element in a data structure.
50 exam-style questions on Edexcel GCSE Computer Science Constructs, covering Structural components of programs and Writing programs with control constructs. Each one has a worked solution and a mark scheme showing where the marks go.