Cambridge A2 Level Computer Science 9618 · 20.1 Programming Paradigms

Q6 · 9618/32/M/J/22 Q2

Worked solution from the Further Programming Paper 3 Advanced Theory booklet, Part 1 of 2.

Q69618/32/M/J/22original Q2Structured · 7 marks
Question 2 from 9618/32/M/J/22

Worked solution

(a)

Sam studies history, and Nina is his tutor.

studies(sam, history).
tutors(nina, sam).

Clause 18 is studies(sam, history). [1]

Clause 19 is tutors(nina, sam). [1]

(b)

Clauses 09 and 12 give geography.

Write: Student = freya, hua (either order) [1]

(c)

The tutor R teaches subject S, student X studies S and R tutors X. Use R and S in two clauses to link them.

teaches(R, S), studies(X, S), tutors(R, X).

X is used for the student [1]

Two other variables (R and S) used in the correct places [1]

Three correct clauses (in any order) [1]

Correct syntax: commas between clauses and a full stop at the end [1]

KEY IDEAA shared variable across clauses links facts together, so the goal only returns values that satisfy every clause.
TOTAL 7 marks

Official mark scheme

Mark scheme for 9618/32/M/J/22 question 2
VIDEO
▶ Whole paper

Video solution of the whole paper · by qiphyedu. 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.