Figure 1 shows a Python program.
Figure 1
score = int(input("Enter score: "))
if score >= 50:
print("Pass")
else:
print("Fail")
The program in Figure 1 needs to be modified so that it repeats eight times using definite (count-controlled) iteration.
Select the option that does this correctly.
count = 0
while count < 8:
score = int(input("Enter score: "))
if score >= 50:
print("Pass")
else:
print("Fail")
count = count + 1
for count in range(0, 8):
score = int(input("Enter score: "))
if score >= 50:
print("Pass")
else:
print("Fail")
for count in range(0, 9):
score = int(input("Enter score: "))
if score >= 50:
print("Pass")
else:
print("Fail")
count = 1
while count <= 8:
score = int(input("Enter score: "))
if score >= 50:
print("Pass")
else:
print("Fail")
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.