You are on page 1of 28

INTERNATIONAL GCSE

COMPUTER SCIENCE
9210
Paper 1 Programming

Mark scheme
June 2019
Version: 1.0 Final

*196Y92101/MS*
MARK SCHEME – INTERNATIONAL GCSE COMPUTER SCIENCE – 9210/1 – JUNE 2019

Mark schemes are prepared by the Lead Assessment Writer and considered, together with the relevant
questions, by a panel of subject teachers. This mark scheme includes any amendments made at the
standardisation events which all associates participate in and is the scheme which was used by them in
this examination. The standardisation process ensures that the mark scheme covers the students’
responses to questions and that every associate understands and applies it in the same correct way.
As preparation for standardisation each associate analyses a number of students’ scripts. Alternative
answers not already covered by the mark scheme are discussed and legislated for. If, after the
standardisation process, associates encounter unusual answers which have not been raised they are
required to refer these to the Lead Assessment Writer.

It must be stressed that a mark scheme is a working document, in many cases further developed and
expanded on the basis of students’ reactions to a particular paper. Assumptions about future mark
schemes on the basis of one year’s document should be avoided; whilst the guiding principles of
assessment remain constant, details will change, depending on the content of a particular examination
paper.

Further copies of this mark scheme are available from oxfordaqaexams.org.uk

Copyright © 2019 Oxford International AQA Examinations and its licensors. All right reserved.

2
MARK SCHEME – INTERNATIONAL GCSE COMPUTER SCIENCE – 9210/1 – JUNE 2019

Level of response marking instructions


Level of response mark schemes are broken down into levels, each of which has a descriptor. The
descriptor for the level shows the average performance for the level. There are marks in each level.

Before you apply the mark scheme to a student’s answer read through the answer and annotate it (as
instructed) to show the qualities that are being looked for. You can then apply the mark scheme.

Step 1 Determine a level


Start at the lowest level of the mark scheme and use it as a ladder to see whether the answer meets the
descriptor for that level. The descriptor for the level indicates the different qualities that might be seen in
the student’s answer for that level. If it meets the lowest level then go to the next one and decide if it
meets this level, and so on, until you have a match between the level descriptor and the answer. With
practice and familiarity you will find that for better answers you will be able to quickly skip through the
lower levels of the mark scheme.

When assigning a level you should look at the overall quality of the answer and not look to pick holes in
small and specific parts of the answer where the student has not performed quite as well as the rest. If
the answer covers different aspects of different levels of the mark scheme you should use a best fit
approach for defining the level and then use the variability of the response to help decide the mark within
the level, ie if the response is predominantly level 3 with a small amount of level 4 material it would be
placed in level 3 but be awarded a mark near the top of the level because of the level 4 content.

Step 2 Determine a mark


Once you have assigned a level you need to decide on the mark. The descriptors on how to allocate
marks can help with this. The exemplar materials used during standardisation will help. There will be an
answer in the standardising materials which will correspond with each level of the mark scheme. This
answer will have been awarded a mark by the Lead Examiner. You can compare the student’s answer
with the example to determine if it is the same standard, better or worse than the example. You can then
use this to allocate a mark for the answer based on the Lead Examiner’s mark on the example.

You may well need to read back through the answer as you apply the mark scheme to clarify points and
assure yourself that the level and the mark are appropriate.

Indicative content in the mark scheme is provided as a guide for examiners. It is not intended to be
exhaustive and you must credit other valid points. Students do not have to cover all of the points
mentioned in the Indicative content to reach the highest level of the mark scheme.

An answer which contains nothing of relevance to the question must be awarded no marks.

3
MARK SCHEME – INTERNATIONAL GCSE COMPUTER SCIENCE – 9210/1 – JUNE 2019

The following annotation is used in the mark scheme:


; - means a single mark
// - means alternative response
/ - means an alternative word or sub-phrase
A. - means acceptable creditworthy answer
R - means reject answer as not creditworthy
NE - means not enough
I - means ignore
DPT - in some questions a specific error made by a candidate, if repeated, could result in the candidate
failing to gain more than one mark. The DPT label indicates that this mistake should only result in
a candidate failing to gain one mark on the first occasion that the error is made. Provided that the
answer remains understandable, subsequent marks should be awarded as if the error was not
being repeated.

4
MARK SCHEME – INTERNATIONAL GCSE COMPUTER SCIENCE – 9210/1 – JUNE 2019

Question Part Marking guidance Total marks

01 1 PlayerOneTurn; 2
PlayerOneWins;
AO3=2

01 2 GetCardChoice // GetCardValues; 1

AO3=1

01 3 Pass values to the subroutine; 2


Make subroutines self-contained;
(make programs) easier to test/debug; AO3=2
Produce code that is more re-useable;
Avoid using global variables;
A. Pass values out of the subroutine (VB/C# only);

Max 2

01 4 (1D) array/list; 2
of type string;
AO3=2

01 5 (The third else if applies) when a tops card is played by the first 2
player; and the second player did not play a tops card;
// AO3=2
When the two cards are of different suits; and the first player’s
suit is a tops card;

A. P instead of tops card

01 6 Temp is used to ensure that the cards at Pos1 and Pos2 are 2
swapped; without card at Pos1/Pos2 being
duplicated/overwritten; AO3=2
//
If this was not used then there would end up being two copies of
one card; and one card would be removed from /not be in the
deck;

01 7 27 would mean 54 cards would be needed; and there are only 2


52 in the deck;
// AO3=2
A runtime error will occur // program will crash; when executing
the DealCards subroutine;
//
Program will attempt to access a position in Deck/a list/an
array; that is out of bounds;

5
MARK SCHEME – INTERNATIONAL GCSE COMPUTER SCIENCE – 9210/1 – JUNE 2019

Question Part Marking guidance Total marks

02 1 Set PlayerTwoRoundsWon to 0; 1

AO3=1

02 2 Is PlayerOneTurn True? 1
//
Is it player one’s turn?; AO3=1

02 3 Get player one’s card choice; 1

AO3=1

02 4 Get card values; 1

AO3=1

6
MARK SCHEME – INTERNATIONAL GCSE COMPUTER SCIENCE – 9210/1 – JUNE 2019

Question Part Marking guidance Total marks

03 1 The number of iterations is unknown; 2


Don’t know (in advance) how many times the user will want to
play the game; AO3=2
It allows the user to choose to play another game or not after
each completed game;
The loop will keep repeating while a condition is true; A.
answers which state the condition

Max 2

03 2 Condition Same 3
functionality
(Yes/No)? AO3=3
CardsInHand is less than 0 No
PlayerOneWins is False No
CardsInHand does not equal 0 Yes
Size of PlayerOneHand is greater than Yes
0
Sum of PlayerOneRoundsWon and No
PlayerTwoRoundsWon is equal to
value of CardsInHand

One row correct;


Two rows correct;
All rows correct;

7
MARK SCHEME – INTERNATIONAL GCSE COMPUTER SCIENCE – 9210/1 – JUNE 2019

Question Part Marking guidance Total marks

04 1 1 mark: Program displays correct message. 3


A minor typos and incorrect case.
1 mark: Statement is at a position so that message is displayed AO3=3
each time an incorrect value for the number of cards is entered
and isn’t displayed when a valid value is entered. The mark can
be awarded even if the message displayed is incorrect.
1 mark: Blank line is printed before error message is displayed.

Python
def GetNumberOfCardsInHand():
print("How many cards will there be in each
player's hand?")
CardsInHand = int(input())
while CardsInHand < 2 or CardsInHand >= 14:
print()
print("Invalid - please try again")
CardsInHand = int(input())
return CardsInHand

Python – alternative answer


def GetNumberOfCardsInHand():
print("How many cards will there be in each
player's hand?")
CardsInHand = int(input())
while CardsInHand < 2 or CardsInHand >= 14:
print()
CardsInHand = int(input("Invalid - please
try again"))
return CardsInHand

C#
static int GetNumberOfCardsInHand()
{
int CardsInHand;
Console.WriteLine("How many cards will
there be in each player's hand?");
CardsInHand =
Convert.ToInt32(Console.ReadLine());
while (CardsInHand < 2 || CardsInHand > 13)
{
Console.WriteLine();
Console.WriteLine("Invalid - please try
again");
CardsInHand =
Convert.ToInt32(Console.ReadLine());
}
return CardsInHand;
}

8
MARK SCHEME – INTERNATIONAL GCSE COMPUTER SCIENCE – 9210/1 – JUNE 2019

VB
Function GetNumberOfCardsInHand() As Integer
Dim CardsInHand As Integer
Console.WriteLine("How many cards will
there be in each player's hand?")
CardsInHand = Console.ReadLine()
While CardsInHand < 2 Or CardsInHand > 13
Console.WriteLine()
Console.WriteLine("Invalid - please try
again")
CardsInHand = Console.ReadLine()
End While
Return CardsInHand
End Function

04 2 Screen capture(s) must match code from 04.1. 1

1 mark: Correct error message displayed each time invalid value AO3=1
entered, and not displayed when valid value entered.

A. incorrect message and missing blank line if it matches code in


04.1.

9
MARK SCHEME – INTERNATIONAL GCSE COMPUTER SCIENCE – 9210/1 – JUNE 2019

Question Part Marking guidance Total marks

05 1 1 mark: Selection structure added in suitable place in code. 5


1 mark: Correct condition for selection structure.
1 mark: Program displays triangles if, and only if, suit is T. AO3=5
A. minor typos and incorrect case.
I. minor typos and incorrect case.
1 mark: Program still works correctly if suit is not T.
1 mark: Program does not display T if suit is T.

Python
def DisplayHand(Hand, PlayerName):
print()
print(PlayerName + "'s hand is:")
for Card in Hand:
Suit = Card[0]
Rank = Card[1:]
print(Rank, end="")
print(" of ", end= "")
if Suit == "T":
print("triangles")
else:
print(Suit)
print()

C#
static void DisplayHand(List<string> Hand,
string PlayerName)
{
string Suit;
string Rank;
Console.WriteLine();
Console.WriteLine(PlayerName + "'s hand
is:");
foreach (string Card in Hand)
{
Suit = Card.Substring(0, 1);
Rank = Card.Substring(1, Card.Length -
1);
Console.Write(Rank);
Console.Write(" of ");
if (Suit == "T")
Console.WriteLine("triangles");
else
Console.WriteLine(Suit);
}
Console.WriteLine();
}

10
MARK SCHEME – INTERNATIONAL GCSE COMPUTER SCIENCE – 9210/1 – JUNE 2019

VB
Sub DisplayHand(ByVal Hand As List(Of String),
ByVal PlayerName As String)
Dim Suit As String
Dim Rank As String
Console.WriteLine()
Console.WriteLine(PlayerName + "'s hand
is:")
For Each Card As String In Hand
Suit = Card.Substring(0, 1)
Rank = Card.Substring(1, Card.Length -
1)
Console.Write(Rank)
Console.Write(" of ")
If Suit = "T" Then
Console.WriteLine("triangles")
Else
Console.WriteLine(Suit)
End If
Next
Console.WriteLine()
End Sub

05 2 Screen capture(s) must match code from 05.1. 1

1 mark: triangles displayed instead of T for all relevant cards. AO3=1

A. incorrect message if it matches code in 05.1.

11
MARK SCHEME – INTERNATIONAL GCSE COMPUTER SCIENCE – 9210/1 – JUNE 2019

Question Part Marking guidance Total marks

06 1 1 mark: The original line of code has been replaced with an 7


appropriate message requesting the input of the tops suit.
1 mark: The value for tops suit is input and stored in a variable AO3=7
of an appropriate type.
1 mark: An appropriate loop is used to check for a valid input
with one correct condition.
1 mark: Correct second condition with correct logical operator.
1 mark: Appropriate error message displayed in loop.
1 mark: Prompt for new tops suit and value input in loop.
1 mark: Error message displayed under correct circumstances
and only under correct circumstances.

A. Alternative logic/order that produces same result.

Python
CardsInHand = GetNumberOfCardsInHand()
Tops = input("Enter suit to be used for tops:
")
while Tops != 'P' and Tops != 'C':
print("Error, only a valid suit value should
be entered (P or C): ")
Tops = input("Enter suit to be used for tops:
")
Deck = ["PH","P2","P3","P4","P5"…………………
Deck = ShuffleDeck(Deck)

C#
CardsInHand = GetNumberOfCardsInHand();
Console.Write("Enter suit to be used for tops:
");
Tops = Console.ReadLine();
while (Tops != "P" && Tops != "C")
{
Console.WriteLine("Error, only a valid suit
value should be entered (P or C): ");
Console.Write("Enter suit to be used for
tops: ");
Tops = Console.ReadLine();
}
Deck = new List<string>
{"PH","P2","P3","P4","P5"…
ShuffleDeck(Deck);

VB
CardsInHand = GetNumberOfCardsInHand()
Console.Write("Enter suit to be used for tops:
")

12
MARK SCHEME – INTERNATIONAL GCSE COMPUTER SCIENCE – 9210/1 – JUNE 2019

Tops = Console.ReadLine()
While Tops <> "P" And Tops <> "C"
Console.WriteLine("Error, only a valid suit
value should be entered (P or C): ")
Console.Write("Enter suit to be used for
tops: ")
Tops = Console.ReadLine()
End While
Deck = New List(Of String) From {"PH", "P2",
"P3"…
ShuffleDeck(Deck)

06 2 Screen capture(s) must match code from 06.1. 2

1 mark: Appropriate prompt and "T" entered followed by an AO3=2


error message
1 mark: the message "Player Two look away from
the screen…" is displayed when "C" entered.

Enter suit to be used for Tops: T


Error, only a valid suit value should be entered (C or P):
Enter suit to be used for Tops: C
Player two look away from the screen. Press Enter to display
player one's hand

13
MARK SCHEME – INTERNATIONAL GCSE COMPUTER SCIENCE – 9210/1 – JUNE 2019

Question Part Marking guidance Total marks

07 1 1 mark: Selection structure added in suitable place in code. 7


1 mark: One correct condition for selection structure.
1 mark: Both correct conditions for selection structure with AO3=7
correct logical operators.
1 mark: 3 points added in the if part of selection structure.
1 mark: The message "3 points scored this round"
in the if part of the selection structure.
1 mark: Else part includes code that adds half point
1 mark: The message "A half point scored this
round" displayed in the Else part.
I. minor typos and incorrect case in messages.

A. Alternative logic/order that produces same result.

Python
PlayerOneWins =
DecideWinnerOfRound(PlayerOneSuit,
PlayerOneRank, PlayerTwoSuit, PlayerTwoRank,
PlayerOneTurn, Tops)
if PlayerOneWins:
PlayerOneRoundsWon += 1
if Tops == PlayerOneSuit and PlayerOneRank <=
6:
PlayerOnePoints += 3
print("3 points scored this round")
else:
PlayerOnePoints += 0.5
print("A half point scored this round")
print("Player One won that round")

Alternative answer
if Tops == PlayerOneSuit and PlayerOneRank <=
6:
PlayerOnePoints += 3
print("3 points scored this round")
else:
PlayerOnePoints += 0.5

C#
if (PlayerOneWins)
{
PlayerOneRoundsWon += 1;
if (Tops == PlayerOneSuit && PlayerOneRank <=
6)
{
PlayerOnePoints += 3;
Console.WriteLine("3 points scored this
round");
}

14
MARK SCHEME – INTERNATIONAL GCSE COMPUTER SCIENCE – 9210/1 – JUNE 2019

else
{
PlayerOnePoints += 0.5;
Console.WriteLine("A half point scored
this round");
}
Console.WriteLine("Player One won that
round.");
}

VB
If PlayerOneWins Then
PlayerOneRoundsWon += 1
If Tops = PlayerOneSuit And PlayerOneRank <=
6 Then
PlayerOnePoints += 3
Console.WriteLine("3 points scored this
round")
Else
PlayerOnePoints += 0.5
Console.WriteLine("A half point scored this
round")
End If
Console.WriteLine("Player One won that
round")
Else
print("A half point scored this round")

07 2 Screen capture(s) must match code from 07.1. 2

1 mark: suitable choices made for the two cards used in their AO3=2
test.
1 mark: "3 points scored this round" message is
displayed when suitable test data was entered.
A. incorrect message if it matches code in 07.1.

Player one, Enter card to use (suit then rank e.g. C3, S10, TK):
P4
Player two, Enter card to use (suit then rank e.g. C3, S10, TK):
S7
3 points scored this round
Player one won that round

15
MARK SCHEME – INTERNATIONAL GCSE COMPUTER SCIENCE – 9210/1 – JUNE 2019

Question Part Marking guidance Total marks

08 1 1 mark: A subroutine with the correct name 08


(GetBonusPointRounds) is created.
1 mark: Generates a random number. AO3=8
1 mark: Use of selection and random numbers gives a 50%
chance of Player One being asked to make the prediction.
1 mark: Use of selection and random numbers gives a 50%
chance of Player Two being asked to make the prediction and
only one player makes a prediction. A. incorrect percentage as Formatted: Font: Bold
long as the percentage chance for the two options adds up to
100%
1 mark: Gets integer value from user in appropriate place(s).
1 mark: Returns value entered by user.
1 mark: Returns an indicator for which player made the
prediction.
1 mark: Appropriate message(s) indicating which player is being
asked to make the prediction in selection structure that uses
random number in condition.

Max 7 if solution not fully working

Python
def GetBonusPointRounds():
RandNo = random.randint(0, 1)

if RandNo == 0:
Rounds = int(input("Player One how many
rounds do you think you will win?"))
else:
Rounds = int(input("Player Two how many
rounds do you think you will win?"))
if RandNo == 1:
Rounds = Rounds * -1
return Rounds

Alternative answer
def GetBonusPointRounds():
Player = random.randint(1, 2)
if Player == 1:
Rounds = int(input("Player One how many
rounds do you think you will win?"))
else:
Rounds = int(input("Player Two how many
rounds do you think you will win?"))
return Player, Rounds

C#
static int GetBonusPointsRounds()
{
int RandNo;

16
MARK SCHEME – INTERNATIONAL GCSE COMPUTER SCIENCE – 9210/1 – JUNE 2019

int Rounds;
Random RandomInt = new Random();
RandNo = RandomInt.Next(0, 2);
if (RandNo == 0)
{
Console.Write("Player One how many rounds
do you think you will win?");
Rounds = int.Parse(Console.ReadLine());
}
else
{
Console.Write("Player Two how many rounds
do you think you will win?");
Rounds = int.Parse(Console.ReadLine());
}
if (RandNo == 1)
Rounds = Rounds * -1;
return Rounds;
}

Alternative answer
static void GetBonusPointsRounds(ref int
Player, ref int Rounds)
{
int RandNo;
Random RandomInt = new Random();
RandNo = RandomInt.Next(1, 3);
if (RandNo == 1)
{
Console.Write("Player One how many rounds
do you think you will win?");
Rounds = int.Parse(Console.ReadLine());
}
else
{
Console.Write("Player Two how many rounds
do you think you will win?");
Rounds = int.Parse(Console.ReadLine());
}
}

VB
Function GetBonusPointsRounds() As Integer
Dim RandNo As Integer
Dim Rounds As Integer
Dim RandomInt = New Random()
RandNo = RandomInt.Next(0, 2)
If RandNo = 0 Then
Console.Write("Player One how many rounds
do you think you will win?")
Rounds = Console.ReadLine()
Else

17
MARK SCHEME – INTERNATIONAL GCSE COMPUTER SCIENCE – 9210/1 – JUNE 2019

Console.Write("Player Two how many rounds


do you think you will win?")
Rounds = Console.ReadLine()
End If
If RandNo = 1 Then
Rounds = Rounds * -1
End If
Return Rounds
End Function

Alternative answer
Sub GetBonusPointsRounds(ByRef Player As
Integer, ByRef Rounds As Integer)
Dim RandNo As Integer
Dim RandomInt = New Random()
RandNo = RandomInt.Next(1, 3)
If RandNo = 1 Then
Console.Write("Player One how many rounds
do you think you will win?")
Rounds = Console.ReadLine()
Else
Console.Write("Player Two how many rounds
do you think you will win?")
Rounds = Console.ReadLine()
End If
End Sub

08 2 1 mark: subroutine GetBonusPointRounds is called in the 5


correct place in the code.
1 mark: return value(s) stored in appropriately-named variables. AO3=5
1 mark: Selection structure(s) with correct syntax added in
correct place in code.
1 mark: Selection structure(s) modify one of the player’s point
total correctly for either when the prediction was accurate or for
when the prediction was inaccurate.
1 mark: Point total change made correctly under all
circumstances.

Max 4 if solution not fully working

Python

def Main():
Again = "Y"
while Again == "Y":
CardsInHand = GetNumberOfCardsInHand()
Tops = "P"
Deck =
["PH","P2","P3","P4","P5","P7","P8","P9","P10",

18
MARK SCHEME – INTERNATIONAL GCSE COMPUTER SCIENCE – 9210/1 – JUNE 2019

"PA","PN","PK","CH","C2","C3","C4","C5","C6","C
7","C8","C9","C10","CA","CN","CK","TH","T2","T3
","T4","T5","T6","T7","T8","T9","T10","TA","TN"
,"TK","SH","S2","S3","S4","S5","S6","S7","S8","
S9","S10","SA","SN","SK"]
Deck = ShuffleDeck(Deck)
PlayerOneHand, PlayerTwoHand, Deck =
DealCards(Deck, CardsInHand)
DisplayHandsAtStartOfGame(PlayerOneHand,
PlayerTwoHand)
RoundsForBonusPoint = GetBonusPointRounds()
PlayerOnePoints, PlayerTwoPoints,
PlayerOneRoundsWon, PlayerTwoRoundsWon =
PlayGame(CardsInHand, PlayerOneHand,
PlayerTwoHand, Tops)
if RoundsForBonusPoint > 0:
if PlayerOneRoundsWon ==
RoundsForBonusPoint:
PlayerOnePoints += 1
else:
PlayerOnePoints -= 1
else:
if PlayerTwoRoundsWon == -
RoundsForBonusPoint:
PlayerTwoPoints += 1
else:
PlayerTwoPoints -= 1
DisplayFinalResult(PlayerOnePoints,
PlayerTwoPoints)
Again = input("Play again (enter Y for
Yes)?")
print()

Alternative answer

BonusPlayer, RoundsForBonusPoint =
GetBonusPointRounds()
PlayerOnePoints, PlayerTwoPoints,
PlayerOneRoundsWon, PlayerTwoRoundsWon =
PlayGame(CardsInHand, PlayerOneHand,
PlayerTwoHand, Tops)
if BonusPlayer == 1:
if PlayerOneRoundsWon ==
RoundsForBonusPoint:
PlayerOnePoints += 1
else:
PlayerOnePoints -= 1
else:
if PlayerTwoRoundsWon ==
RoundsForBonusPoint:
PlayerTwoPoints += 1
else:

19
MARK SCHEME – INTERNATIONAL GCSE COMPUTER SCIENCE – 9210/1 – JUNE 2019

PlayerTwoPoints -= 1

C#

DisplayHandsAtStartOfGame(Deck, PlayerOneHand,
PlayerTwoHand);
RoundsForBonusPoint = GetBonusPointsRounds();
PlayGame(CardsInHand, PlayerOneHand,
PlayerTwoHand, Tops, ref PlayerOnePoints, ref
PlayerTwoPoints, ref PlayerOneRoundsWon, ref
PlayerTwoRoundsWon);
if (RoundsForBonusPoint > 0)
{
if (PlayerOneRoundsWon ==
RoundsForBonusPoint)
PlayerOnePoints += 1;
else
PlayerOnePoints -= 1;
}
else
{
if (PlayerTwoRoundsWon == -
RoundsForBonusPoint)
PlayerTwoPoints += 1;
else
PlayerTwoPoints -= 1;
}
DisplayFinalResult(PlayerOnePoints,
PlayerTwoPoints);

Alternative answer

DisplayHandsAtStartOfGame(Deck, PlayerOneHand,
PlayerTwoHand);
GetBonusPointsRounds(ref BonusPlayer, ref
RoundsForBonusPoint);
PlayGame(CardsInHand, PlayerOneHand,
PlayerTwoHand, Tops, ref PlayerOnePoints, ref
PlayerTwoPoints, ref PlayerOneRoundsWon, ref
PlayerTwoRoundsWon);
if (BonusPlayer ==1)
{
if (PlayerOneRoundsWon ==
RoundsForBonusPoint)
PlayerOnePoints += 1;
else
PlayerOnePoints -= 1;

20
MARK SCHEME – INTERNATIONAL GCSE COMPUTER SCIENCE – 9210/1 – JUNE 2019

}
else
{
if (PlayerTwoRoundsWon ==
RoundsForBonusPoint)
PlayerTwoPoints += 1;
else
PlayerTwoPoints -= 1;
}
DisplayFinalResult(PlayerOnePoints,
PlayerTwoPoints);

VB

DisplayHandsAtStartOfGame(Deck, PlayerOneHand,
PlayerTwoHand)
RoundsForBonusPoint = GetBonusPointsRounds()
PlayGame(CardsInHand, PlayerOneHand,
PlayerTwoHand, Tops, PlayerOnePoints,
PlayerTwoPoints, PlayerOneRoundsWon,
PlayerTwoRoundsWon)
If RoundsForBonusPoint > 0 Then
If PlayerOneRoundsWon = RoundsForBonusPoint
Then
PlayerOnePoints += 1
Else
PlayerOnePoints -= 1
End If
Else
If PlayerTwoRoundsWon = -RoundsForBonusPoint
Then
PlayerTwoPoints += 1
Else
PlayerTwoPoints -= 1
End If
End If
DisplayFinalResult(PlayerOnePoints,
PlayerTwoPoints)

Alternative answer

DisplayHandsAtStartOfGame(Deck, PlayerOneHand,
PlayerTwoHand)
GetBonusPointsRounds(BonusPlayer,
RoundsForBonusPoint)
PlayGame(CardsInHand, PlayerOneHand,
PlayerTwoHand, Tops, PlayerOnePoints,
PlayerTwoPoints, PlayerOneRoundsWon,
PlayerTwoRoundsWon)
If BonusPlayer = 1 Then
If PlayerOneRoundsWon = RoundsForBonusPoint

21
MARK SCHEME – INTERNATIONAL GCSE COMPUTER SCIENCE – 9210/1 – JUNE 2019

Then
PlayerOnePoints += 1
Else
PlayerOnePoints -= 1
End If
Else
If PlayerTwoRoundsWon = RoundsForBonusPoint
Then
PlayerTwoPoints += 1
Else
PlayerTwoPoints -= 1
End If
End If
DisplayFinalResult(PlayerOnePoints,
PlayerTwoPoints)

08 3 Screen capture(s) must match code from 08.1 and 08.2. 2

1 mark: Evidence that a player made a prediction of one and AO3=2


then played a game where each player started with three cards.

1 mark: The player who made the prediction is shown as having


1.5 points and the other player as having one point (only award
this mark if prediction of winning one round was accurate).
//
1 mark: The player who made the prediction is shown as having
zero points and the other player as having 0.5 points (only
award this mark if player who made prediction won two rounds).
//
1 mark: The player who made the prediction is shown as having
0.5 points and the other player as having zero point (only award
this mark if player who made prediction won three rounds).
//

22
MARK SCHEME – INTERNATIONAL GCSE COMPUTER SCIENCE – 9210/1 – JUNE 2019

1 mark: The player who made the prediction is shown as having


minus one point and the other player as having 1.5 points (only
award this mark if player who made prediction didn’t win any
rounds).

Note for examiners: players may have higher scores if question


7 has been answered and one or more of the rounds were won
with a low-rank tops card.

23
MARK SCHEME – INTERNATIONAL GCSE COMPUTER SCIENCE – 9210/1 – JUNE 2019

Question Part Marking guidance Total marks

09 1 1 mark: A subroutine with the correct name (ReplaceCard) is 11


created
1 mark: subroutine has two correct parameters (Deck, AO3=11
PlayerTwoHand)
1 mark: Calculates the position of the last card in the hand
(length of PlayerTwoHand - 1, or subtracting 1 from
additional parameter of CardsInHand)
1 mark: Appropriate message is displayed regarding choice of
replacing card at front or back of hand
1 mark: Value entered by user about choice stored in
appropriately-named variable value of suitable data type (either
char or string) A. answers that use the value entered without
storing it – but only if it has been used correctly
1 mark: Gets first card in Deck
1 mark: Selection statement(s) that determines if cards replaced
from the front or from the back of the hand
1 mark: Card replaced correctly from the front of the hand
1 mark: Card replaced correctly from the back of the hand
1 mark: DisplayHand subroutine called, after card replaced,
with correct parameters (PlayerTwoHand , 'Player Two')
1 mark: Returns amended hand Note: in C# and VB there
doesn’t need to be an explicit return command as lists are
reference types

Max 10 if solution not fully working

Python
def ReplaceCard(Deck, PlayerTwoHand):
MaxCardsToChange = len(PlayerTwoHand);
print("Player Two")
ReplaceFrom = input("Enter 'F' to replace
card at the front of your hand or 'B' to
replace card at the back of your hand: ")
if ReplaceFrom == "F":
Index = 0
elif ReplaceFrom == "B":
Index = MaxCardsToChange – 1
PlayerTwoHand[Index] = Deck[0]
del Deck[0:1]
DisplayHand(PlayerTwoHand, "Player Two")
return PlayerTwoHand

C#
static List<string> ReplaceCard(List<string>
Deck, List<string> PlayerTwoHand)
{
char ReplaceFrom;
int Index=0;

24
MARK SCHEME – INTERNATIONAL GCSE COMPUTER SCIENCE – 9210/1 – JUNE 2019

Console.WriteLine("Player Two");
Console.Write("Enter 'F' to replace card at
the front of your hand or 'B' to replace card
at the back of your hand: ");
ReplaceFrom = char.Parse(Console.ReadLine());
if (ReplaceFrom == 'F')
Index = 0;
else if (ReplaceFrom == 'B')
Index = PlayerTwoHand.Count - 1;
PlayerTwoHand[Index] = Deck[0];
Deck.RemoveRange(0, 1);
DisplayHand(PlayerTwoHand, "Player Two");
return PlayerTwoHand;
}

VB
Function ReplaceCard(ByVal Deck As List(Of
String), ByVal PlayerTwoHand As List(Of
String)) As List(Of String)
Dim ReplaceFrom As Char
Dim Index As Integer
Console.WriteLine("Player Two")
Console.Write("Enter 'F' to replace card at
the front of your hand or 'B' to replace card
at the back of your hand: ")
ReplaceFrom = Console.ReadLine()
If ReplaceFrom = "F" Then
Index = 0
ElseIf ReplaceFrom = "B" Then
Index = PlayerTwoHand.Count - 1
End If
PlayerTwoHand(Index) = Deck(0)
Deck.RemoveRange(0, 1)
DisplayHand(PlayerTwoHand, "Player Two")
Return PlayerTwoHand
End Function

09 2 1 mark: The subroutine ReplaceCard is called in the correct 2


place in the code with the correct parameters for player two
(Deck, PlayerTwoHand) AO3=2
1 mark: ReplaceCard updates player two’s hand

Python
def DisplayHandsAtStartOfGame(Deck,
PlayerOneHand, PlayerTwoHand):
input("Player Two look away from the
screen. Press Enter to display Player One's
hand.")
DisplayHand(PlayerOneHand, "Player One")
input("Press Enter to continue.")

25
MARK SCHEME – INTERNATIONAL GCSE COMPUTER SCIENCE – 9210/1 – JUNE 2019

for Count in range(10):


print()
input("Player One look away from the
screen. Press Enter to display Player Two's
hand.")
DisplayHand(PlayerTwoHand, "Player Two")
input("Press Enter to continue.")
for Count in range(10):
print()
print("Number of cards left in the deck: ",
len(Deck))
print()
PlayerTwoHand = ReplaceCard(Deck,
PlayerTwoHand)

C#
static void
DisplayHandsAtStartOfGame(List<string> Deck,
List<string> PlayerOneHand, List<string>
PlayerTwoHand)
{
int Count;
Console.WriteLine("Player Two look away from
the screen. Press Enter to display Player
One's hand.");
Console.ReadLine();
DisplayHand(PlayerOneHand, "Player One");
Console.WriteLine("Press Enter to
continue.");
Console.ReadLine();
for (Count = 0; Count < 25; Count++)
Console.WriteLine();
Console.WriteLine("Player One look away from
the screen. Press Enter to display Player
Two's hand.");
Console.ReadLine();
DisplayHand(PlayerTwoHand, "Player Two");
Console.WriteLine("Press Enter to
continue.");
Console.ReadLine();
for (Count = 0; Count < 25; Count++)
Console.WriteLine();
Console.WriteLine("Number of cards left in
the deck: " + Deck.Count);
Console.WriteLine();
PlayerTwoHand = ReplaceCard(Deck,
PlayerTwoHand);
}

26
MARK SCHEME – INTERNATIONAL GCSE COMPUTER SCIENCE – 9210/1 – JUNE 2019

VB
Sub DisplayHandsAtStartOfGame(ByVal Deck As
List(Of String), ByVal PlayerOneHand As List(Of
String), ByVal PlayerTwoHand As List(Of
String))
Dim Count As Integer
Console.WriteLine("Player Two look away from
the screen. Press Enter to display Player
One's hand.")
Console.ReadLine()
DisplayHand(PlayerOneHand, "Player One")
Console.WriteLine("Press Enter to continue.")
Console.ReadLine()
For Count = 0 To 24
Console.WriteLine()
Next
Console.WriteLine("Player One look away from
the screen. Press Enter to display Player
Two's hand.")
Console.ReadLine()
DisplayHand(PlayerTwoHand, "Player Two")
Console.WriteLine("Press Enter to continue.")
Console.ReadLine()
For Count = 0 To 24
Console.WriteLine()
Next
Console.WriteLine("Number of cards left in
the deck: " & Deck.Count)
Console.WriteLine()
PlayerTwoHand = ReplaceCard(Deck,
PlayerTwoHand)
End Sub

27
MARK SCHEME – INTERNATIONAL GCSE COMPUTER SCIENCE – 9210/1 – JUNE 2019

09 3 Screen capture(s) must match code from 9.1 and 9.2. 2

1 mark: Evidence of appropriate prompt to change cards in their AO3=2


hand. Have selected to replace card from the back of their
hand.

1 mark: Evidence of hand before and after card replaced. The


back card replaced.

Player two's hand is:


4 of T
2 of S
10 of T
4 of C
2 of P
7 of T
9 of C
K of S

Press Enter to continue.

Number of cards left in the deck: 36

Player Two
Enter 'F' to replace card at the front of your hand or 'B' to replace
card at the back of your hand: B

Player two's hand is:


4 of T
2 of S
10 of T
4 of C
2 of P
T of T
9 of C
9 of S

Player one, enter card to use (suit then rank e.g. C3, S10, TK):

28

You might also like