Exam preparation · GCSE · about 20 min
Taking a question apart, the jobs that come up again and again, and how the marks are given.
[1 mark]You cannot finish a programming question. What is the best thing to do?
[1 mark]Which of these earns marks in a written programming answer?
[1 mark]A question says to reject an input over 60. What is that worth?
[1 mark]What does this program print?
done = 0
steps = 0
while done < 32:
step = min(7, 32 - done)
done = done + step
steps = steps + 1
print(steps, done)[1 mark]What should you do before writing any code in a long question?
Write the program for this question. The robot must drive far centimetres in steps of step centimetres, where the last step is whatever is left over. After each step, print so far: <n> cm. At the end print steps: <n> and total: <n> cm. Use the values given; do not type the answers.
# the two lines every program starts with: the commands, then the robot from bugbot import * connect() far = 32 step = 7
Plan your program here, then type it in and press Run.
far to 30 and step to 5. Does your program still print the right number of steps?step of 0 and say why, instead of looping forever.for loop instead of a while loop. Which reads better here?