A Python program is shown below:
reading = float(input("Enter pressure (bar): "))
if reading > 2.5:
print("WARNING")
else:
print("OK")
The program needs to be modified so that it repeats exactly eight times using definite (count-controlled) iteration. Select the option that accomplishes this correctly.
count = 0
while count < 8:
reading = float(input("Enter pressure (bar): "))
if reading > 2.5:
print("WARNING")
else:
print("OK")
count = count + 1
for count in range(0, 8):
reading = float(input("Enter pressure (bar): "))
if reading > 2.5:
print("WARNING")
else:
print("OK")
for count in range(0, 9):
reading = float(input("Enter pressure (bar): "))
if reading > 2.5:
print("WARNING")
else:
print("OK")
count = 1
while count <= 8:
reading = float(input("Enter pressure (bar): "))
if reading > 2.5:
print("WARNING")
else:
print("OK")
count = count + 1
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.