A programmer is writing an algorithm to perform integer division using repeated subtraction. The subroutine is shown in Figure 1.
SUBROUTINE divide(x, y)
p ← x
q ← 0
WHILE p ≥ y DO
p ← p - y
q ← q + 1
ENDWHILE
OUTPUT q
ENDSUBROUTINE
The identifier for the variable q in Figure 1 is not a good choice.
State a better identifier for this variable that makes the algorithm easier to read and understand.
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.