Cambridge O Level Computer Science 2210 · 7.9 Writing and amending algorithms

Q106 · 2210/22/O/N/24 Q3

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

Q1062210/22/O/N/24original Q3Structured · 10 marks
Question 3 from 2210/22/O/N/24

Worked solution

(a)

Draw one line from each symbol to its purpose.

Rectangle with double side lines → subroutine [1]

Rounded (oval) shape → terminator [1]

Diamond → decision [1]

Plain rectangle → process [1]

The purpose "flow" is not used.

(b)

Draw the flowchart in this order, joined by arrows:

START at the top and STOP at the end, both in terminator (rounded) shapes [1]

Process boxes Total ← 0 and Count ← 1 before the loop. Inside the loop, Count ← Count + 1, then a decision diamond IS Count > 50 ? The No arrow goes back up to the prompt. [1]

Input: an output box with a prompt, OUTPUT "Enter a value between 1 and 100", then an input box INPUT Number [1]

Total set to 0 first, and a process box Total ← Total + Number inside the loop [1]

The Yes arrow goes to an output box with a message, OUTPUT "The total is ", Total [1]

All arrows, Yes/No labels and symbols correct [1]

KEY IDEAA flowchart loop needs a set-up, a body, an increment and a decision diamond that sends the arrow back.
TOTAL 10 marks

Official mark scheme

Mark scheme for 2210/22/O/N/24 question 3
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.