Cambridge O Level Computer Science 2210 · 7.7 Trace tables

Q58 · 2210/23/O/N/23 Q8

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

Q582210/23/O/N/23original Q8Structured · 8 marks
Question 8 from 2210/23/O/N/23

Worked solution

(a)

Accept counts Y inputs and Reject counts the others. The algorithm stops asking when Accept reaches 10. Then Reject is 2, which is more than 1, so Error = 2 / 10 × 100 = 20.

AcceptRejectPartOKErrorOUTPUT
00
1Y
2Y
3Y
1N
4Y
5Y
6Y
7Y
2N
8Y
9Y
10Y20
Too many rejected 20% error

Accept column correct [1]

Reject column correct [1]

PartOK column correct [1]

Error column correct [1]

OUTPUT column correct [1]

(b)

Write:

Put the change after the INPUT box and before the first decision [1]

Insert a new process box there [1]

In it, convert the input to upper case [1]

Or change the first decision box so it also accepts 'y' by adding OR PartOK = 'y' (this way scores the same three marks).

KEY IDEATrace only the boxes the flowchart reaches, and test for both cases of a letter when input could be either.
TOTAL 8 marks

Official mark scheme

Mark scheme for 2210/23/O/N/23 question 8
VIDEO
▶ Whole paper

Video solution of the whole paper · by O/Alevel CS by Wasiq. 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.