A telemetry program processes a sensor reading and outputs a status message:
reading = float(input("Enter telemetry reading: "))
if reading > 100.0:
print("Warning: Threshold exceeded")
else:
print("Normal")
The program needs to be modified so that it repeats this process exactly six times using definite (count-controlled) iteration.
Select the option that correctly implements this requirement.
count = 0
while count < 6:
reading = float(input("Enter telemetry reading: "))
if reading > 100.0:
print("Warning: Threshold exceeded")
else:
print("Normal")
count += 1
for i in range(1, 6):
reading = float(input("Enter telemetry reading: "))
if reading > 100.0:
print("Warning: Threshold exceeded")
else:
print("Normal")
for i in range(0, 6):
reading = float(input("Enter telemetry reading: "))
if reading > 100.0:
print("Warning: Threshold exceeded")
else:
print("Normal")
for i in range(0, 7):
reading = float(input("Enter telemetry reading: "))
if reading > 100.0:
print("Warning: Threshold exceeded")
else:
print("Normal")
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.