Past-paper question · 2018 May-June · Paper 42 · Q4(b)

Question 4(b) 2018 · May-June · Paper 42 · 5 marks

Original past-paper question for 4(B)
Original past-paper question for 4(B)
Original past-paper question for 4(B)
Reveal official mark-scheme answer Official mark-scheme answer for 4(B)Official mark-scheme answer for 4(B)Official mark-scheme answer for 4(B)

Official answer for Question 4

Part (b)

Question 1

mark per bullet to max 5

Question 5

✓
•
✓
class declaration
✓
•
✓
FirstName, LastName, DateOfBirth and Gender all defined as private
✓
•
✓
constructor declaration
✓
•
✓
«all four attributes assigned values from parameters
✓
•
✓
(Public) method for Introduction
✓
•
✓
«outputs message with FirstName and LastName attributes
✓
// returns FirstName and LastName
✓
•
✓
Public method for DisplayFullNameAndDateofbirth
✓
•
✓
« outputs message with FirstName, LastName and DateOfBirth
✓
// returns FirstName, LastName, DateOfBirth
✓
Python example code:
✓
class Member:
✓
def __init__(self, Fname, Lname, DOB, GenderVal):
✓
self.__FirstName = Fname
✓
self.__LastName = Lname
✓
self.__DateOfBirth = DOB
✓
self.__Gender = GenderVal
✓
def Introduction(self):
✓
return "Hello, I am ", self.__FirstName, " ",
✓
self.LastName
✓
def DisplayFullnameAndDateofbirth(self):
✓
print self.__FirstName, self.__LastName,
✓
self.__DateOfBirth
✓
9608/42
✓
Cambridge International AS/A Level – Mark Scheme
✓
May/June 2018
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks

Mark scheme 9608_s18_ms_42.pdf →

Show text version of question

Question 4

Part (b)

Question 4

X-Games is an international extreme sports competition.

A
program will store and process data about the teams in the competition.
  • Each team is made up of members.
  • Members can be added and removed from each team.
  • Each member has a first name, last name, date of birth and gender.
  • Each member can be an official or a competitor.
  • Each official has a job title and may be first-aid trained.
  • Each competitor takes part in one sport.

The program is written using object-oriented programming.

The program can output the full name and date of birth of any member. For example, “Nadia Abad 16/05/1995”

An introduction about a team member can be output using their name. For example, “Hello, I’m Nadia Abad”.

The program outputs a different version of the introduction for a competitor. This version includes the competitor’s sport. For example, “Hello, I’m Sally Jones and my sport is Skateboard Park.”

Question 13

Part (b)

Write program code for the Member class.

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

Program code

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

...............................................................................................................................................[5]

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

Keep practising this topic