A declarative programming language is used to represent the features that are available and the features that are unavailable on different body styles of a car. 01 feature(sunroof). 02 feature(automatic_tailgate). 03 feature(heated_seats). 04 feature(extra_seats). 05 feature(reversing_camera). 06 feature(dashboard_camera). 07 feature(air_conditioning). 08 feature(heated_windscreen). 09 feature(satnav). 10 bodystyle(saloon). 11 bodystyle(hatchback). 12 bodystyle(estate). 13 bodystyle(minivan). 14 bodystyle(convertible). 15 available(sunroof, hatchback). 16 available(sunroof, minivan). 17 available(reversing_camera, hatchback). 18 available(extra_seats, minivan). 19 available(reversing_camera, saloon). 20 unavailable(sunroof, convertible). 21 unavailable(automatic_tailgate, saloon). 22 unavailable(extra_seats, hatchback). These clauses have the meanings: Clause Meaning 01 Sunroof is a feature. 10 Saloon is a body style. 15 Sunroof is available on a hatchback. 20 Sunroof is unavailable on a convertible.
- (a)Sliding doors is a feature that is available on a minivan but unavailable on a hatchback. Write additional clauses to represent this information. 23 24 25[3]
- (b)Using the variable Options, the goal: available(Options, saloon) returns Options = reversing_camera Write the result returned by the goal: available(Options, hatchback) Options =[1]
- (c)F may be available for B if F is a feature and B is a body style and F is not unavailable for that body style. Write this as a rule: may_choose_option(F, B) IF[4]
Mark scheme
Marking points from the official mark scheme (May/June 2024). The mark or mark type is shown in brackets.
- [3] 8(a) One mark for each correctly completed clause (Max 3)
- 8(a) (23) feature(sliding_doors).
- 8(a) (24) available(sliding_doors, minivan).
- 8(a) (25) unavailable(sliding_doors, hatchback).
- [1] 8(b) (Options =) sunroof, reversing_camera
- [4] 8(c) One mark per mark point (Max 4)
- 8(c) MP1 feature (F)
- 8(c) MP2 bodystyle(B)
- 8(c) MP3 unavailable(F, B)
- 8(c) MP4 all correct Boolean operators and punctuation (allow, for AND) and no additional lines of code
- 8(c) Example answers
- 8(c) may_choose_option(F, B)
- 8(c) IF
- 8(c) feature(F) AND bodystyle(B) AND NOT unavailable(F, B).
- 8(c) feature(F), bodystyle(B), NOT unavailable(F, B).
Write your answer and get it marked
On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.
Sign up free →