Question 5(d)(ii) 2018 · May-June · Paper 43 · 3 marks
Reveal official mark-scheme answer
Official answer for Question 5
Part (d)
(ii)
Question 1
mark per bullet
Question 3
- Function declaration with no parameters
- Use inherited GetDetails method to get string
- Return all values
Show text version of question
Question 5
Part (d)
(ii)
Question 5
A computer game is being developed using object-oriented programming. The following image is
a screenshot from the game.
There are scenery elements and animated elements. The player’s character is one of the animated elements.
Each game element has the attributes:
Attribute Description Example value The x coordinate of the game PositionX 92 element. The y coordinate of the game PositionY 106 element. Width The width of the game element. 150 Height The height of the game element. 200 The filename of the image file for ImageFilename GameElementFrame1.png the game element.
Each game element has a method, GetDetails() that returns a string containing all the element’s attributes.
The player’s character is one of a number of animated elements. All animated elements have the attributes:
Attribute Description Example value AnimationFrames An array of GameElement
Direction object is travelling in.
Strength indicates the power of the object.
Health indicates the health of the object.
The player’s character can either move left or right, or jump.
Question 11
(ii)
An additional method, GetScenery(), returns all the attributes of the Scenery class.
Write program code for the GetScenery() method.
You should use the GetDetails() method that the Scenery class inherits from the GameElement class.
Programming language .....................................................................................................
Program code
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[3]
Question 16
Why this question appears here
98% assigned-topic match · Further programming › Programming paradigms
Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.
Permanent source page: Educate A Change · From 9608_s18_qp_43.pdf
