Past-paper question · 2019 May-June · Paper 43 · Q2(d)(vi)

Question 2(d)(vi) 2019 · May-June · Paper 43 · 8 marks

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

Official answer for Question 2

Part (d)

(vi)

Question 1

mark per bullet point

Question 8

✓
•
✓
CreatePlayer() header and close (where appropriate)
✓
•
✓
Input of score and PlayerID with suitable prompts
✓
•
✓
Create instance of Player named JoannePlayer «
✓
•
✓
«with PlayerID as parameter
✓
•
✓
Call method SetScore for JoannePlayer with parameter Score
✓
•
✓
«storing return value
✓
•
✓
«outputting appropriate message for not valid
✓
•
✓
Call SetCategory for JoannePlayer
✓
•
✓
Output Category for JoannePlayer «
✓
•
✓
« using GetCategory for object Joanne
✓
PYTHON
✓
def CreatePlayer():
✓
InputPlayerID = input("Enter your chosen ID")
✓
Score = int(input("Please enter the score"))
✓
JoannePlayer = Player(InputPlayerID)
✓
if JoannePlayer.SetScore(Score) == false:
✓
print("Invalid score")
✓
else:
✓
JoannePlayer.SetCategory()
✓
print(JoannePlayer.GetCategory)
✓
PASCAL
✓
procedure CreatePlayer();
✓
var
✓
playerID : String;
✓
isValid : boolean;
✓
JoannePlayer : Player;
✓
score : integer;
✓
begin
✓
Writeln(Enter Player ID: ');
✓
Readln(playerID);
✓
Writeln('Enter score: ');
✓
Readln(score);
✓
JoannePlayer := Player.Create(PlayerID);
✓
isValid := JoannePlayer.SetScore(Score);
✓
if isValid = true:
✓
JoannePlayer.SetCategory();
✓
Writeln(JoannePlayer.GetCategory());
✓
else:
✓
Writeln("Invalid score")
✓
end;
✓
9608/43
✓
Cambridge International AS/A Level – Mark Scheme
✓
May/June 2019
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks

Mark scheme 9608_s19_ms_43.pdf →

Show text version of question

Question 2

Part (d)

(vi)

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

(vi)

Joanne has played the first game to place her in a category for the competition.

The procedure CreatePlayer()performs the following tasks.

  • allows the player ID and score to be input with suitable prompts
  • creates an instance of Player with the identifier JoannePlayer
  • sets the score for the object
  • sets the category for the object
  • outputs the category for the object

Write program code for the CreatePlayer()procedure.

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

Program code

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[8]

Question 15

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

Keep practising this topic