You are on page 1of 17

INTERNATIONAL

GCSE
COMPUTER SCIENCE
(9210)
Unit 1 Programming
Mark scheme

Specimen 2018

Copyright © 2018 Oxford International AQA Examinations and its licensors. All rights reserved.
2

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.

Copyright © 2018 Oxford International AQA Examinations and its licensors. All rights reserved.
3

International GCSE Computer Science mark scheme


How to Mark

Aims
When you are marking your allocation of scripts your main aims should be to:

• recognise and identify the achievements of students


• place students in the appropriate mark band and in the appropriate part of that mark band (high, low,
middle) for each Assessment Objective
• record your judgements with brief notes, annotations and comments that are relevant to the mark
scheme and make it clear to other examiners how you have arrived at the numerical mark awarded
for each Assessment Objective
• put into a rank order the achievements of students (not to grade them − that is done later using the
rank order that your marking has produced)
• ensure comparability of assessment for all students, regardless of question or examiner.

Approach
It is important to be open minded and positive when marking scripts.

The specification recognises the variety of experiences and knowledge that students will have. It
encourages them to study language in a way that is relevant to them. The questions have been designed
to give them opportunities to discuss what they have found out about language. It is important to assess
the quality of what the student offers.

Do not mark scripts as though they were mere shadows of some Platonic ideal (or the answer you would
have written). The mark schemes have been composed to assess quality of response and not to
identify expected items of knowledge.

Assessment Objectives
This component requires students to:

AO1: Demonstrate knowledge and understand of the key concepts and principles of computer science.
AO2: Apply knowledge and understanding of key concepts and principles of computer science.
AO3: Analyse problems in computational terms in order to develop and test programmed solutions and
demonstrate an understanding of programming concepts.

Annotating scripts
You should write a summative comment at the end for each Assessment Objective and indicate the
marks for each Assessment Objective being tested at the end of the answer in the margin in sequence. It
is vital that the way you arrive at a mark should be recorded on the script. This will help you with making
accurate judgements and it will help any subsequent markers to identify how you are thinking. Please do
not write negative comments about students’ work or their alleged aptitudes; this is unprofessional and it
impedes a positive marking approach.

Copyright © 2018 Oxford International AQA Examinations and its licensors. All rights reserved.
4

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 loss of
more than one mark. The DPT label indicates that this mistake should result in a candidate losing
only 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.

Copyright © 2018 Oxford International AQA Examinations and its licensors. All rights reserved.
5

Qu Part Marking guidance Total


marks

01 1 1 mark: Key // CharPos // CharacterCode 1

AO3=1

01 2 1 mark: InputPlainText // InputCipherText // InputKey 1


// LoadPlainText // DisplayMenu // Main
AO3=1

01 3 1 mark: Any command from list below. 1

• Dim CipherText As String = "" AO3=1


• CharPos = 0
• Character = PlainText(CharPos)
• CharacterCode = Asc(Character)
• CharacterCode = CharacterCode + Key
• CharacterCode = CharacterCode - 26
• CipherText = CipherText + Chr(CharacterCode)

01 4 1 mark: The number of iterations is known. 2


1 mark: The loop counter will be automatically incremented // code
will not have to be written (separately) to maintain a counter // a AO3=2
counter is needed to access the characters.

01 5 1 mark: If the code is too high it will not be an alphabetic symbol. 2


1 mark: Subtracting 26 will turn it back into an alphabetic symbol //
subtracting 26 wraps the symbol back onto the alphabet. AO3=2

Copyright © 2018 Oxford International AQA Examinations and its licensors. All rights reserved.
6

02 1 mark: CipherText assigned initial value of JSB and Key 7


assigned initial value of 4.
1 mark: CharPos stores sequence of values 0, 1, 2 and no other AO3=7
values.
1 mark: Character stores sequence of values J, S, B and no
other values.
1 mark: CharacterCode stores the values 74, 83 and 66 in that
order. There may or may not be other values between/before/after
these.
1 mark: CharacterCode changes from 74 to 70 and from 83 to
79.
1 mark: CharacterCode changes from 66 to 62 then 88.
1 mark: PlainText stores sequence of values F, FO, FOX.

Max 6 if table contains any additional values (but allow repetition of


values)

Example completed table:

CipherText Key CharPos Character CharacterCode PlainText


JSB 4 0 J 74
70 F
1 S 83
79 FO
2 B 66
62
88 FOX

03 1 mark: The boxes for inputting and outputting the filename should 5
be the other way around.
1 mark: The Yes and No labels are on the wrong branches // the AO3=5
boxes on the YES and No branches are on the wrong branches.
1 mark: Write PlainText to File should be Read from not Write to.
1 mark: The line above Close File is missing an arrow.
1 mark: The value returned should be PlainText not FileName.

Copyright © 2018 Oxford International AQA Examinations and its licensors. All rights reserved.
7

04 1 1 mark: Program displays correct title. 3


A minor typos and incorrect case.
1 mark: Statement is at a position so that title is displayed at the top AO3=3
of the menu. The mark can be awarded even if the title displayed is
incorrect.
1 mark: There is a blank line displayed between the title and the
menu.

Sub DisplayMenu()
Console.WriteLine("CIPHER SYSTEM")
Console.WriteLine()
Console.WriteLine("K Input Key")
Console.WriteLine("P Input Plaintext")
Console.WriteLine("C Input Ciphertext")
Console.WriteLine("L Load Plaintext")
Console.WriteLine("E Encrypt Plaintext")
Console.WriteLine("D Decrypt Ciphertext")
Console.WriteLine("Q Quit")
End Sub

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


1 mark: Correct title displayed at top of menu.
A incorrect title and missing blank line if it matches code in 04.1. AO3=1

05 1 1 mark: Program displays correct text in message. 3


1 mark: Program displays correct variable value in message and this
is on same line as message text AO3=3
1 mark: Message displayed at bottom of menu.
A minor typos and incorrect case.

Sub Main()

Dim MenuOption As Char


Dim Key As Integer = 3
Dim PlainText As String = ""
Dim CipherText As String = ""

Do
DisplayMenu()
Console.WriteLine("The Current Key is " & Key)
Console.Write("Enter Option > ")

Copyright © 2018 Oxford International AQA Examinations and its licensors. All rights reserved.
8

MenuOption = Console.ReadLine().ToUpper()

Select Case MenuOption


Case "K"
Key = InputKey()
Case "P"
PlainText = InputPlainText()
Case "C"
CipherText = InputCipherText()
Case "L"
PlainText = LoadPlainText()
Console.WriteLine("Plaintext is : " +
PlainText)
Case "E"
CipherText = Encrypt(PlainText, Key)
Console.WriteLine("Ciphertext is : " +
CipherText)
Case "D"
PlainText = Decrypt(CipherText, Key)
Console.WriteLine("Plaintext is : " +
PlainText)
End Select
Loop Until MenuOption = "Q"

End Sub

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


1 mark: Message displayed that indicates current key value.
I if message is not the correct one or is displayed at the wrong point AO3=1
in the program.

06 1 1 mark: Correct test of lower boundary (<1 or <=0) 6


1 mark: Correct test of upper boundary (>25 or >=26).
1 mark: Error message displayed if value outside of one boundary. AO1=3
1 mark: Error message displayed if value outside of the other
boundary.
1 mark: Error message informs user of what the problem is.
1 mark: User forced to reinput if value outside of either boundary.

Note that the last four marks can be awarded if the boundaries are

Copyright © 2018 Oxford International AQA Examinations and its licensors. All rights reserved.
9

incorrect.

Function InputKey() As Integer


Dim Key As Integer
Do
Console.Write("Please enter the key value: ")
Key = Console.ReadLine()
If Key < 1 Or Key > 25 Then
Console.WriteLine("Key value is not between 1
and 25")
End If
Loop Until Key >= 1 And Key <= 25
Return Key
End Function

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


1 mark: Error message displayed for input of key 36.
1 mark: Error message displayed for input of key 0. AO3=3
1 mark: Error message not displayed for input of key 25.

07 1 1 mark: Correct option "R Random Key" added to menu. 1


I minor typing mistakes and where option appears in menu.
AO3=1
Sub DisplayMenu()
Console.WriteLine("CIPHER SYSTEM")
Console.WriteLine()
Console.WriteLine("R Random Key")
Console.WriteLine("K Input Key")
Console.WriteLine("P Input Plaintext")
Console.WriteLine("C Input Ciphertext")
Console.WriteLine("L Load Plaintext")
Console.WriteLine("E Encrypt Plaintext")
Console.WriteLine("D Decrypt Ciphertext")
Console.WriteLine("Q Quit")
End Sub

Copyright © 2018 Oxford International AQA Examinations and its licensors. All rights reserved.
10

07 2 1 mark: Selection structure modified so that input of R is detected. 5


1 mark: When R input a random integer is generated.
1 mark: Random integer assigned to variable Key. AO3=5
1 mark: Random integer has lower limit of 1.
1 mark: Random integer has upper limit of 25.

Sub Main()

Dim MenuOption As Char


Dim Key As Integer = 3
Dim PlainText As String = ""
Dim CipherText As String = ""
Dim Sequence As System.Random = New System.Random()

Do
DisplayMenu()
Console.WriteLine("The Current Key is " & Key)
Console.Write("Enter Option > ")
MenuOption = Console.ReadLine().ToUpper()

Select Case MenuOption


Case "R"
Key = Sequence.Next(1, 26)
Case "K"
Key = InputKey()
Case "P"
PlainText = InputPlainText()
Case "C"
CipherText = InputCipherText()
Case "L"
PlainText = LoadPlainText()
Console.WriteLine("Plaintext is : " +
PlainText)
Case "E"
CipherText = Encrypt(PlainText, Key)
Console.WriteLine("Ciphertext is : " +
CipherText)
Case "D"
PlainText = Decrypt(CipherText, Key)
Console.WriteLine("Plaintext is : " +
PlainText)
End Select
Loop Until MenuOption = "Q"

End Sub

Copyright © 2018 Oxford International AQA Examinations and its licensors. All rights reserved.
11

07 3 Screen capture(s) must match code from 07.1 and 07.2. 1


1 mark: User has selected the random key option and a randomly
generated key value is displayed. Note that code in 07.2 must be AO3=1
examined to verify that the key was randomly generated.
I if the value is not in the correct range.

08 1 1 mark: If statement is used to attempt to check if character is a 6


lowercase letter.
1 mark: Correct boundaries are used for If statement. AO3=6
1 mark: Key added to CharacterCode for lower case letters
(award this mark if there is a minor error in the range of characters)
1 mark: If statement checks if resultant CharacterCode is past
end of alphabet.
1 mark: If CharacterCode is past end of alphabet, 26 subtracted.
1 mark: Characters that are not upper case or lower case letters
continue to be copied from PlainText to CipherText (Award
award this mark only if an attempt has been made to deal with lower
case letters).

Max 3 if functionality with upper case letters has been broken by the
modifications.

Function Encrypt(PlainText As String, Key As Integer) As


String

Dim CharPos As Integer


Dim CipherText As String = ""
Dim Character As Char
Dim CharacterCode As Integer

For CharPos = 0 To PlainText.Length - 1


Character = PlainText(CharPos)
CharacterCode = Asc(Character)
If Character >= "A" And Character <= "Z" Then
CharacterCode = CharacterCode + Key
If CharacterCode > Asc("Z") Then
CharacterCode = CharacterCode - 26
End If
End If
If Character >= "a" And Character <= "z" Then
CharacterCode = CharacterCode + Key

Copyright © 2018 Oxford International AQA Examinations and its licensors. All rights reserved.
12

If CharacterCode > Asc("z") Then


CharacterCode = CharacterCode - 26
End If
End If
CipherText = CipherText + Chr(CharacterCode)
Next
Return CipherText

End Function

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


1 mark: Plaintext Hello Sam entered.
1 mark: Ciphertext Khoor Vdp displayed. AO3=2

9 1 1 mark: Selection structure modified so that input of A detected. 3


1 mark: When A entered the CountCharacters subroutine is
called. A if incorrect subroutine name used but matches that in 09.2 AO3=3
1 mark: CipherText passed as parameter.

Sub Main()

Dim MenuOption As Char


Dim Key As Integer = 3
Dim PlainText As String = ""
Dim CipherText As String = ""
Dim Sequence As System.Random = New System.Random()

Do
DisplayMenu()
Console.WriteLine("The Current Key is " & Key)
Console.Write("Enter Option > ")
MenuOption = Console.ReadLine().ToUpper()

Select Case MenuOption


Case "A"
CountCharacters(CipherText)
Case "R"
Key = Sequence.Next(1, 26)
Case "K"

Copyright © 2018 Oxford International AQA Examinations and its licensors. All rights reserved.
13

Key = InputKey()
Case "P"
PlainText = InputPlainText()
Case "C"
CipherText = InputCipherText()
Case "L"
PlainText = LoadPlainText()
Console.WriteLine("Plaintext is : " +
PlainText)
Case "E"
CipherText = Encrypt(PlainText, Key)
Console.WriteLine("Ciphertext is : " +
CipherText)
Case "D"
PlainText = Decrypt(CipherText, Key)
Console.WriteLine("Plaintext is : " +
PlainText)
End Select
Loop Until MenuOption = "Q"

End Sub

9 2 1 mark: A subroutine with the correct name (CountCharacters) 8


is created.
1 mark: CipherText is received by subroutine as a parameter. AO3=8
1 mark: Loop that either iterates through all the capital letters or
iterates along the length of the CipherText string.
1 mark: Counter for each character initialised to zero. (This could be
just one counter reused for each character or an array of counters
depending on implementation.)
1 mark: Appropriate counter updated each time a character occurs in
CipherText.
1 mark: Each character that was counted is output.
1 mark: The count is output alongside character.
1 mark: Every character in the string (or every capital letter) is
counted and output. (A counts not output for characters with zero
occurrences.)

Max 7 if solution not fully working

Sub CountCharacters(CipherText As String)


Dim CharCode As Integer
Dim CharPos As Integer
Dim CharCount As Integer
For CharCode = Asc("A") To Asc("Z")
CharCount = 0
For CharPos = 0 To CipherText.Length - 1
If Asc(CipherText(CharPos)) = CharCode Then
CharCount = CharCount + 1
End If
Next
Console.WriteLine(Chr(CharCode) & " " & CharCount)
Next

Copyright © 2018 Oxford International AQA Examinations and its licensors. All rights reserved.
14

End Sub

9 3 Screen capture(s) must match code from 09.1 and 09.2. 2

1 mark: Correct options selected and correct ciphertext input AO3=2


(JBPPXDB JB PLLK).
1 mark: Characters and correct counters displayed A if incorrect
ciphertext used award this mark if the count is correct for the
ciphertext entered
I characters with counter values of 0 are / are not shown

Copyright © 2018 Oxford International AQA Examinations and its licensors. All rights reserved.
15

10 1 1 mark: A subroutine with the correct name (EncryptTranspose) 10


is created.
1 mark: PlainText received by subroutine is a parameter. AO3=10
1 mark: CipherText is returned by subroutine to calling function.
(Award mark regardless of whether or not CipherText is correct.)
1 mark: Loop created with number of iterations controlled by length
of PlainText string. (Exact number of iterations may vary
depending on if done in single characters or pairs and how odd
length strings are dealt with.)
1 mark: Characters are copied from the PlainText and appended
to the CipherText within the loop. (Award mark regardless of
whether or not this is done correctly.)
1 mark: Characters are processed in pairs.
1 mark: Correct pairs of characters are correctly swapped.
1 mark: A test is made to check if the PlainText is of odd/even
length.
1 mark: If the PlainText is of odd length the final character is
added to the end of the CipherText.
1 mark: Fully correct conversion from PlainText to
CipherText.

Function EncryptTranspose(PlainText As String) As String

Dim PairNum As Integer


Dim PairCount As Integer
Dim CipherText As String = ""

PairCount = PlainText.Length \ 2
For PairNum = 0 To PairCount - 1
CipherText = CipherText + PlainText(PairNum * 2 + 1)
+ PlainText(PairNum * 2)
Next
If PlainText.Length Mod 2 = 1 Then
CipherText = CipherText + PlainText(PlainText.Length
- 1)
End If
Return CipherText

End Function

Copyright © 2018 Oxford International AQA Examinations and its licensors. All rights reserved.
16

10 2 1 mark: Selection structure modified so that input of T detected 4


1 mark: When T entered the EncryptTranspose function is
called A If incorrect function name used but matches that in 10.1 AO3=4
1 mark: PlainText passed as parameter and return value stored
as CipherText.
1 mark: Value of CipherText is displayed on screen.

Sub Main()

Dim MenuOption As Char


Dim Key As Integer = 3
Dim PlainText As String = ""
Dim CipherText As String = ""
Dim Sequence As System.Random = New System.Random()

Do
DisplayMenu()
Console.WriteLine("The Current Key is " & Key)
Console.Write("Enter Option > ")
MenuOption = Console.ReadLine().ToUpper()

Select Case MenuOption


Case "T"
CipherText = EncryptTranspose(PlainText)
Console.WriteLine("Ciphertext is : " +
CipherText)
Case "A"
CountCharacters(CipherText)
Case "R"
Key = Sequence.Next(1, 26)
Case "K"
Key = InputKey()
Case "P"
PlainText = InputPlainText()
Case "C"
CipherText = InputCipherText()
Case "L"
PlainText = LoadPlainText()
Console.WriteLine("Plaintext is : " +
PlainText)
Case "E"
CipherText = Encrypt(PlainText, Key)
Console.WriteLine("Ciphertext is : " +
CipherText)
Case "D"
PlainText = Decrypt(CipherText, Key)
Console.WriteLine("Plaintext is : " +
PlainText)
End Select
Loop Until MenuOption = "Q"

End Sub

Copyright © 2018 Oxford International AQA Examinations and its licensors. All rights reserved.
17

10 3 Screen capture(s) must match code from 10.1 and 10.2. 2


1 mark: Plaintext CROCODILE entered.
1 mark: Ciphertext RCCODOLIE displayed. AO3=2

Copyright © 2018 Oxford International AQA Examinations and its licensors. All rights reserved.

You might also like