9618/33/M/J/24 question 8: worked solution (May/June 2024, paper 33)

Show as 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. Q15 9618/33/M/J/24 original Q8 Structured · 8 marks Worked solution (a) Sliding doors is a feature, it is available on a minivan and unavailable on a hatchback. 23 feature(sliding_doors). 24 available(sliding_doors, minivan). 25 unavailable(sliding_doors, hatchback). feature(sliding_doors) [1] available(sliding_doors, minivan) [1] unavailable(sliding_doors, hatchback) [1] (b) Look for available facts ending in hatchback: clauses 15 and 17. Write: Options = sunroof, reversing_camera [1] (c) F must be a feature, B a body style and F must not be unavailable for B. may_choose_option(F, B) IF feature(F) AND bodystyle(B) AND NOT unavailable(F, B) feature(F) [1] bodystyle(B) [1] NOT unavailable(F, B) [1] All operators and punctuation correct (a comma is allowed for AND), with no extra lines [1] KEY IDEA Write facts as clauses, and build a rule from facts joined with AND and NOT. TOTAL 8 marks Official mark scheme VIDEO ▶ Whole paper Video solution of the whole paper · by CsWithMym. Tap the picture to open it on YouTube.