Computer Science (AS & A Level) · May / June 2021 · Paper 43 · Question 3
9618
As printed in the paper
The question as text
A computer game requires users to travel around a world to find and open treasure chests. Each treasure chest has a mathematics question inside. The user enters the answer. The number of points awarded depends on the number of attempts before the user gives the correct answer. The program will be created using object-oriented programming (OOP). The following class diagram describes the class TreasureChest. TreasureChest question : STRING answer : INTEGER points : INTEGER // stores the question // stores the answer // stores the maximum possible number of points available for this chest constructor() getQuestion() checkAnswer() getPoints() // takes question, answer and points as parameters and creates an instance of an object // returns the question // takes the user’s answer as a parameter and returns True if it is correct, otherwise returns False // takes the number of attempts as a parameter and returns the number of points awarded
Read automatically from the paper; the printed page above is exact.
Show the answer and mark scheme
3(a)[5]
3(b)[8]
3(c)(i)[1]
3(c)(ii)[3]
3(c)(iii)[5]
3(c)(iv)[7]
3(c)(v)[2]
Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.

