9618/32/M/J/22 question 2: worked solution (May/June 2022, 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. Q6 9618/32/M/J/22 original Q2 Structured · 7 marks 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 IDEA A shared variable across clauses links facts together, so the goal only returns values that satisfy every clause. TOTAL 7 marks Official mark scheme VIDEO ▶ Whole paper Video solution of the whole paper · by qiphyedu. Tap the picture to open it on YouTube.