Cambridge AS Level Computer Science 9618 · 11.1 Programming Basics

Q10 · 9618/22/M/J/23 Q1

Worked solution from the Programming Paper 2 Problem-solving and Programming booklet, Part 1 of 3.

Q109618/22/M/J/23original Q1Structured · 10 marks
Question 1 from 9618/22/M/J/23

Worked solution

(a)(i)

Use constants [1]

(a)(ii)

Any three of these:

The postal cost is entered once only [1]

It avoids input errors and different values for the same cost in different places [1]

When rates change, the constant is changed once only, so the program is easier to maintain [1]

The program is easier to understand because the constant has a meaningful name (also scores, but only three marks are available).

(b)

Any three of these:

Indentation [1]

Comments [1]

Capital letters for keywords [1]

Sensible, meaningful variable names or white space also score, but only three marks are available.

(c)

ValidAddress: BOOLEAN [1]

ItemPostalCost: REAL [1]

ItemStatus: STRING [1]

KEY IDEAUse named constants for fixed values so they are set once, and use clear layout and names to make code readable.
TOTAL 10 marks

Official mark scheme

Mark scheme for 9618/22/M/J/23 question 1
VIDEO
▶ Starts at Q1 (0:18)

Starts at Q1 (0:18) · by Pseudocode Pro. 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.