Cambridge A2 Level Computer Science 9618 · 20.1 Programming Paradigms

Q14 · 9618/32/M/J/24 Q10

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

Q149618/32/M/J/24original Q10Structured · 9 marks
Question 10 from 9618/32/M/J/24

Worked solution

(a)

Jane is a client, surfing is an activity, she chooses surfing and she has done sailing.

25 client(jane).
26 activity(surfing).
27 choice(jane, surfing).
28 done(jane, sailing).

client(jane) [1]

activity(surfing) [1]

choice(jane, surfing) [1]

done(jane, sailing) [1]

(b)

Look for choice facts ending in sailing: clauses 17, 18 and 21.

Write: List = frankie, erik, henry [1]

(c)

C must be a client, A an activity, and C must not have done A.

may_choose_activity(C, A) IF client(C) AND activity(A) AND NOT done(C, A)

client(C) [1]

activity(A) [1]

NOT done(C, A) [1]

All operators and punctuation correct (a comma is allowed for AND), with the right number of terms and no extra lines [1]

KEY IDEAWrite facts as clauses, and use NOT in a rule to leave out what has already been done.
TOTAL 9 marks

Official mark scheme

Mark scheme for 9618/32/M/J/24 question 10
VIDEO
▶ Starts at Q10 (1:19:09)

Starts at Q10 (1:19:09) · 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.