AQA · GCSE · Computer Science · Higher
Rest been defined as a constant
Explain why rest could have been defined as a constant in the algorithm shown in Figure 1.
Practice unavailable
This question can be viewed, but its original response format is not available for practice yet.
Write your answer first. You can study the marking guidance whenever you need it.
Study the marking See what earns credit and compare it with a full-mark answer.
Marking points
- 1 Explains that rest remains unchanged after initialization.
Full-mark answer
rest could be a constant because its value is set once and does not change while the algorithm runs.
Why this answer loses marks
It is assigned near the start of the algorithm.
A starting assignment alone is not enough; the reason is that the value is not changed afterwards.