9618/32/M/J/24 question 10: worked solution (May/June 2024, paper 32)
Show as plain textHide plain text
Cambridge A2 Level Computer Science 9618 · 20.1 Programming Paradigms Worked solution from the Further Programming Paper 3 Advanced Theory booklet, Part 1 of 2. Q14 9618/32/M/J/24 original Q10 Structured · 9 marks 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 IDEA Write facts as clauses, and use NOT in a rule to leave out what has already been done. TOTAL 9 marks Official mark scheme VIDEO ▶ Starts at Q10 (1:19:09) Starts at Q10 (1:19:09) · by Pseudocode Pro. Tap the picture to open it on YouTube.