Cambridge O Level Computer Science 2210 · 7.7 Trace tables

Q53 · 2210/22/O/N/22 Q6

Worked solution from the Algorithm design and problem-solving Paper 2 Algorithms, Programming and Logic booklet, Part 6 of 8.

Q532210/22/O/N/22original Q6Structured · 5 marks
Question 6 from 2210/22/O/N/22

Worked solution

Follow the flowchart. Numbers below 100 or above 999 skip straight back to the start of the loop. Counter goes up each time round and the loop stops when Counter is more than 7.

CounterNumberHundredsTempTensUnitsOUTPUT
0
197
287687676Hundreds: 8 Tens: 7 Units: 6
34320
46066606Hundreds: 6 Tens: 0 Units: 6
59875
642
712412424Hundreds: 1 Tens: 2 Units: 4
8

Counter and Number columns correct [1]

Hundreds column correct [1]

Temp and Tens columns correct [1]

Units column correct [1]

OUTPUT column correct [1]

KEY IDEAOnly numbers from 100 to 999 are split up; DIV gives the whole part and MOD gives the remainder.
TOTAL 5 marks

Official mark scheme

Mark scheme for 2210/22/O/N/22 question 6
VIDEO
▶ Topic lesson

A lesson on this topic · by Mr Bulmer's Learning Zone. Tap the picture to open it on YouTube.

Solutions follow the official Cambridge mark schemes; marks are shown in grey. Videos are from other YouTube channels. Paper codes read component / series / year: M/J = May/June, O/N = October/November. Past-paper questions © UCLES, reproduced for classroom practice.