Question 14

AQA Computer Science Specimen Paper 1B (8525/1B)GCSE1 mark

On the specification

3.2 Programming
Question text

14 A programmer has written the Python program in Figure 5 to add up the numbers between one and five. Figure 5 total = 0 for number in range(1, 6): total = total + number print(total) The program needs to be changed so that it also multiplies all of the numbers between one and five. Shade one lozenge next to the program that will do what the programmer wants. [1 mark] total = 0 product = 1 for number in range(1, 6): total = total + number A product = total * number print(total) print(product) total = 0 product = 1 for number in range(1, 6): total = total + number B product = product * number print(total) print(product) total = 0 product = 1 for number in range(1, 6): total = total + number C product = product * total print(total) print(product) total = 0 product = 1 for number in range(1, 6): total = total + number D product = (total + product) * number print(total) print(product)