Two different version of a subroutine designed to scale a starting integer n n\,n by repeatedly multiplying it by 3 until it exceeds 100 are shown in the pseudocode below.
SUBROUTINE scale(n)
a ← n
count ← 0
REPEAT
a ← a * 3
count ← count + 1
UNTIL a > 100
OUTPUT count
ENDSUBROUTINE
SUBROUTINE scale(n)
a ← n
count ← 0
WHILE a <= 100
a ← a * 3
count ← count + 1
ENDWHILE
OUTPUT count
ENDSUBROUTINE
Describe two differences in the way the loops in Subroutine A and Subroutine B execute.
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.