Past-paper question · 2019 May-June · Paper 41 · Q2(d)(v)

Question 2(d)(v) 2019 · May-June · Paper 41 · 4 marks

Original past-paper question for 2(D)(V)
Original past-paper question for 2(D)(V)
Original past-paper question for 2(D)(V)
Original past-paper question for 2(D)(V)
Original past-paper question for 2(D)(V)
Original past-paper question for 2(D)(V)
Reveal official mark-scheme answer

Official answer for Question 2

Part (d)

(v)

Question 1

mark per bullet point

Question 4

✓
•
✓
Procedure header and close (where appropriate)
✓
•
✓
Accessing Score attribute
✓
•
✓
Correct selection to assign each category
✓
•
✓
« storing in Category attribute
✓
PYTHON
✓
def SetCategory()
✓
if self.__Score >120:
✓
self.__Category = "Advanced"
✓
elif self.__Score >80:
✓
self.__Category = "Intermediate"
✓
elif self.__Score>=50:
✓
self.__Category = "Beginner"
✓
else:
✓
self.__Category = "Not Qualified"
✓
PASCAL
✓
procedure player.SetCategory()
✓
begin
✓
If Score >120 Then
✓
Category := "Advanced";
✓
Else If Score >80 Then
✓
Category := "Intermediate";
✓
Else If Score >= 50 Then
✓
Category := "Beginner";
✓
Else
✓
Category := "Not Qualified";
✓
end;
✓
VB
✓
Public Sub SetCategory()
✓
If Score >120 Then
✓
Category = "Advanced"
✓
ElseIf Score >80 Then
✓
Category = "Intermediate"
✓
ElseIf Score >=50 Then
✓
Category = "Beginner"
✓
Else
✓
Category = "Not Qualified"
✓
End If
✓
End Sub
✓
9608/41
✓
Cambridge International AS/A Level – Mark Scheme
✓
May/June 2019
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks

Mark scheme 9608_s19_ms_41.pdf →

Show text version of question

Question 2

Part (d)

(v)

Question 2

A computer games club wants to run a competition. The club needs a system to store the scores

achieved in the competition.

A
selection of score data is as follows:

Players complete one game to place them into a category for the competition. The games club wants to implement a program to place players into the correct category. The programmer has decided to use object-oriented programming (OOP).

The highest score that can be achieved in the game is 150. Any score less than 50 will not qualify for the competition. Players will be placed in a category based on their score.

The following diagram shows the design for the class Player. This includes the properties and methods.

Player Score : INTEGER // initialised to 0 Category : STRING // "Beginner", "Intermediate", // "Advanced" or "Not Qualified", initialised // to "Not Qualified" PlayerID : STRING // initialised with the parameter InputPlayerID

Create() // method to create and initialise an object using // language-appropriate constructor SetScore() // checks that the Score parameter has a valid value // if so, assigns it to Score SetCategory() // sets Category based on player’s Score SetPlayerID() // allows a player to change their PlayerID // validates the new PlayerID GetScore() // returns Score GetCategory() // returns Category GetPlayerID() // returns PlayerID

Question 9

(v)

Write program code for the method SetCategory(). Use the properties and methods

in the original class definition.

Players will be placed in one of the following categories.

Category Criteria

Advanced Score is greater than 120 Intermediate Score is greater than 80 and less than or equal to 120 Beginner Score is greater than or equal to 50 and less than or equal to 80 Not Qualified Score is less than 50

Programming language .....................................................................................................

Program code

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

.....................................................................................................................................

[4]

Question 14

Topic relevance

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_s19_qp_41.pdf

Keep practising this topic