A declarative programming language is used to represent subjects that students can choose to study. Students must choose two subjects. [List of clauses 01-21, e.g., '01 subject(mathematics).', '09 student(tomaz).', '15 choice1(tomaz, mathematics).'] These clauses have the meanings: [Table mapping Clause numbers to Meaning]
- (a)Anthony is a student who would like to study history and geography. Write additional clauses to represent this information. 22 23 24[3]
- (b)Using the variable X, the goal: choice1(X, chemistry) returns X = teresa, elspeth Write the result returned by the goal: choice1(X, mathematics) X = [1]
- (c)Students must choose two different subjects such that: N may choose S, if N is a student and S is a subject and N has not chosen S as the first choice. Write this as a rule. may_choose_subject(N, S) IF[4]
Mark scheme
Marking points from the official mark scheme (Oct/Nov 2023). The mark or mark type is shown in brackets.
- [1] One mark for each correctly completed clause (Max 3) (22) student (anthony).
- [1] (23) choice1 (anthony, history).
- [1] (24) choice2(anthony, geography).
- [1] X = tomaz, pietre, nico
- [1] One mark per mark point (Max 4) student (N)
- [1] subject (S)
- [1] choice1 (N, S)
- [1] all logical operators correct with no additional code (see example answers)
- [1] Example answers: may_choose_subject(N, S) IF student(N) AND subject(S) AND NOT choice1(N, S)
- [1] may_choose_subject(N, S) IF NOT choice1(N, S), student(N), subject(S)
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 →