A declarative programming language is used to allow clients to choose daily activities at the beach. 01 activity(paddleboarding). 02 activity(sailing). 03 activity(rowing). 04 activity(kayaking). 05 activity(jetskiing). 06 client(stevie). 07 client(antonio). 08 client(henry). 09 client(eliza). 10 client(rebeka). 11 client(danny). 12 client(erik). 13 client(simone). 14 client(petra). 15 client(frankie). 16 choice(petra, rowing). 17 choice(frankie, sailing). 18 choice(erik, sailing) 19 choice(eliza, rowing) 20 choice(stevie, jetskiing). 21 choice(henry, sailing). 22 done(henry, jetskiing). 23 done(rebeka, jetskiing) 24 done(antonio, kayaking) These clauses have the meanings: Clause Meaning 01 Paddle boarding is an activity. 06 Stevie is a client. 16 Petra has chosen rowing. 22 Henry has already done jet skiing.
- (a)Jane is a client who would like to choose the activity surfing and she has already done sailing. Write additional clauses to represent this information. 25 26 27 28[4]
- (b)Using the variable List, the goal: choice (List, rowing) returns List = petra, eliza Write the result returned by the goal: choice (List, sailing) List =[1]
- (c)c is a client who would like to choose A if A is an activity and c has not already done A. Write this as a rule: may_choose_activity(C, A) IF[4]
Mark scheme
Marking points from the official mark scheme (May/June 2024). The mark or mark type is shown in brackets.
- [4] One mark for each correctly completed clause (Max 4)
- [4] Example answer (25) client(jane).
- [4] (26) activity(surfing).
- [4] (27) choice(jane, surfing).
- [4] (28) done(jane, sailing).
- [1] (List =) frankie, erik, henry
- [4] One mark per mark point (Max 4)
- [4] MP1 client (C)
- [4] MP2 activity(A)
- [4] MP3 done (C, A)
- [4] MP4 all correct Boolean operators and punctuation (allow , for AND). There must be the correct number of terms and no additional lines of code
- [4] Example answers may_choose_activity(C, A) IF client(C) AND activity(A) AND NOT done(C, A). // client(C), activity(A), NOT (done(C, A)).
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 →