Computer Science (9618) · May/June 2026 · Mark scheme · Paper 43
Cambridge International AS & A Level Computer Science mark scheme for Paper 43, May/June 2026 — 9618/43/M/J/26, file 9618 Computer Science June 2026 Mark Scheme 43.pdf.
Text of this paper
Cambridge International AS & A Level
COMPUTER SCIENCE
9618/43
Paper 4 Practical
May/June 2026
MARK SCHEME
Maximum Mark: 75
Published
This mark scheme contains the instructions and marking guidance that our examiners used to mark
candidate responses for this component.
Before they start marking, examiners complete a standardisation process. They review a range of candidate
responses and discuss the mark scheme in detail to agree which answers can and cannot be accepted.
Examiners award marks where it is clear that candidate responses have met the requirements of the mark
scheme. These requirements may vary between different components or different versions of the same
component, depending on the exact requirements of the question and the candidate responses seen during
the standardisation process.
Sometimes, our mark schemes may allow marks to be awarded to responses which contain elements that
are factually incorrect or for content not covered by the syllabus. We do this in response to the demands of a
specific question to support candidates and make sure that our assessments are fair. However, these
allowances should not be used as a guide for teaching and learning.
We cannot discuss the mark scheme with schools, and we recommend that schools read the mark scheme
together with the assessment material and the Principal Examiner Report for Teachers.
This document consists of 46 printed pages.
© Cambridge University Press & Assessment 2026
[Turn over
9618/43
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
May/June 2026
General marking principles
All examiners must apply these marking principles when marking candidate responses.
1
Examiners must award marks for each response in line with:
•
•
•
the specific content defined in the mark scheme
the specific skills defined in the mark scheme or in the level descriptions
the standard of response required as exemplified by the standardisation scripts.
2
Examiners must award whole marks (not half marks, or other fractions).
3
Examiners must award marks positively. This means that:
•
•
•
marks are not deducted for errors or omissions
marks are awarded for correct/valid answers as defined in the mark scheme and also for other valid answers which go beyond the
scope of the syllabus and mark scheme referring to your team leader as appropriate
the quality of spelling, punctuation and grammar are judged only when the mark scheme indicates that these features are specifically
assessed in the question. However, the meaning of all responses must be unambiguous.
4
Examiners must consistently apply the requirements of the mark scheme and any rules for what to do when candidates have not followed
instructions correctly.
5
Examiners must use the full range of marks defined in the mark scheme, unless limited by the quality of the candidate responses seen.
6
Examiners must award marks according to the mark scheme and must not award marks with grade thresholds or grade descriptions in
mind.
© Cambridge University Press & Assessment 2026
Page 2 of 46
9618/43
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
May/June 2026
Annotations guidance for centres
Examiners use a system of annotations as a shorthand for communicating their marking decisions to one another. Examiners are trained during the
standardisation process on how and when to use annotations. The purpose of annotations is to inform the standardisation and monitoring
processes and guide the supervising examiners when they are checking the work of examiners within their team. The meaning of annotations and
how they are used is specific to each component and is understood by all examiners who mark the component.
We publish annotations in our mark schemes to help centres understand the annotations they may see on copies of scripts. Note that there may
not be a direct correlation between the number of annotations on a script and the mark awarded. Similarly, the use of an annotation may not be an
indication of the quality of the response.
The annotations listed below were available to examiners marking this component in this series.
Annotations
Annotation
Meaning
Benefit of the doubt
To indicate where a key word/phrase/code is missing
Incorrect
Follow through
Indicate a point in an answer
Highlighted text
To draw attention to a particular aspect or to indicate where parts of an answer have been combined
Ignore
Not answered question
No benefit of doubt given
No examples or not enough
© Cambridge University Press & Assessment 2026
Page 3 of 46
9618/43
Annotation
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
May/June 2026
Meaning
Not relevant or used to separate parts of an answer
Off-page
comment
Allows comments to be entered at the bottom of the RM marking window and then displayed when the associated question
item is navigated to.
Repetition
Indicates that work or a page has been seen including blank answer spaces and blank pages.
Correct
Too vague
© Cambridge University Press & Assessment 2026
Page 4 of 46
9618/43
•
•
•
•
•
•
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
May/June 2026
Bold in mark scheme means that idea is required.
/ in mark scheme means alternative.
// in mark scheme means alternative solution that gains the same mark point.
… at the end of one mark point without a … at the start of the next just means the sentence follows on. There is no dependency.
… at the end of one mark point and … at the start of the next, this means the second cannot be awarded without the first.
() means what is in the brackets is not required, or it is not required in some languages but may be required in others.
© Cambridge University Press & Assessment 2026
Page 5 of 46
9618/43
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Question
1(a)
Answer
Marks
1 mark for 1D array (of 15 strings)
1
Example program code
Python
DataArray = [] #15 strings
VB.NET
Dim DataArray(14) As String
Java
public static String[] DataArray = new String[15];
© Cambridge University Press & Assessment 2026
May/June 2026
Page 6 of 46
Guidance
9618/43
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Question
1(b)
Answer
Marks
1 mark each
• Procedure header (and end)
• Taking 15 strings as input
• … converting to lower case
• … storing in array
4
Example program code
Python
def CreateArray():
for x in range(15):
DataArray.append(input("Enter a word ").lower())
VB.NET
Sub CreateArray()
For x = 0 To 14
Console.WriteLine("Enter a word ")
DataArray(x) = Console.ReadLine().ToLower()
Next
End Sub
Java
public static void CreateArray(){
Scanner scanner = new Scanner(System.in);
for(Integer x = 0; x < 15; x++){
System.out.println("Enter a word");
DataArray[x] = (scanner.nextLine()).toLowerCase();
}
}
© Cambridge University Press & Assessment 2026
May/June 2026
Page 7 of 46
Guidance
9618/43
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Question
1(c)
May/June 2026
Answer
Marks
1 mark each
• Procedure header (and end) and outputting all data
• … on one line with a space between each element
2
Example program code
Python
def OutputArray():
StringOutput = ""
for x in range(15):
StringOutput = StringOutput + " " + DataArray[x]
print(StringOutput)
VB.NET
Sub OutputArray()
Dim StringOutput As String = ""
For x = 0 To 14
StringOutput = StringOutput + " " + DataArray(x)
Next
Console.WriteLine(StringOutput)
End Sub
Java
public static void OutputArray(){
String StringOutput = "";
for(Integer x = 0; x < 15; x++){
StringOutput += " " + DataArray[x];
}
System.out.println(StringOutput);
}
© Cambridge University Press & Assessment 2026
Page 8 of 46
Guidance
9618/43
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Question
1(d)(i)
Answer
May/June 2026
Marks
1 mark for calling both procedures in the given order
Guidance
1
Example program code
Python
CreateArray()
OutputArray()
VB.NET
CreateArray()
OutputArray()
Java
CreateArray();
OutputArray();
1(d)(ii)
1 mark for showing the 15 inputs and all data output on the same line
e.g.
© Cambridge University Press & Assessment 2026
Page 9 of 46
1 Outputs must be
lowercase
9618/43
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Question
1(e)
Answer
1 mark each
• Procedure header (and end) taking string as input and converting to lower
• Looping through all elements in the array
• … comparing to input
• … counting number of times it occurs
• Outputting final count
© Cambridge University Press & Assessment 2026
Page 10 of 46
May/June 2026
Marks
5
Guidance
9618/43
Question
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Answer
Example program code
Python
def FindWords():
WordFind = input("Enter the word you want to find ").lower()
Counter = 0
for x in range(15):
if(DataArray[x] == WordFind):
Counter = Counter + 1
print("It was found ", Counter, " times")
VB.NET
Sub FindWords()
Console.WriteLine("Enter the word you want to find")
Dim WordFind As String = Console.ReadLine().ToLower()
Dim Counter As Integer = 0
For x = 0 To 14
If DataArray(x) = WordFind Then
Counter = Counter + 1
End If
Next
Console.WriteLine("It was found " & Counter & " times")
End Sub
Java
public static void FindWords(){
Scanner scanner = new Scanner(System.in);
System.out.println("Enter the word you want to find");
String WordFind = (scanner.nextLine()).toLowerCase();
Integer Counter = 0;
for(Integer x = 0; x < 15; x++){
if(DataArray[x].equals(WordFind)){
Counter++;
}
}
System.out.println("It was found " + Counter + " times");
}
© Cambridge University Press & Assessment 2026
Page 11 of 46
May/June 2026
Marks
Guidance
9618/43
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Question
1(f)(i)
Answer
1 mark each
• Procedure header (and end) and iterating through each element (first loop)
• Inner loop
• Stopping the loop when in order (any method)
• Comparing by length …
• … and swapping correctly
© Cambridge University Press & Assessment 2026
Page 12 of 46
May/June 2026
Marks
5
Guidance
9618/43
Question
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Answer
Example program code
Python
def SortLength():
Swap = True
Count = 0
while(Count < 14 and Swap):
Swap = False
for y in range(14):
if(len(DataArray[y]) > len(DataArray[y+1])):
DataArray[y], DataArray[y+1] = DataArray[y+1], DataArray[y]
Swap = True
Count = Count + 1
VB.NET
Sub SortLength()
Dim Temp As String
Dim Swap As Boolean = True
Dim Count As Integer = 0
While Count < 15 And Swap = True
Swap = False
For y = 0 To 13
If DataArray(y).Length > DataArray(y + 1).Length Then
Temp = DataArray(y)
DataArray(y) = DataArray(y + 1)
DataArray(y + 1) = Temp
Swap = True
End If
Next
Count = Count + 1
End While
End Sub
© Cambridge University Press & Assessment 2026
Page 13 of 46
May/June 2026
Marks
Guidance
9618/43
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Question
Answer
May/June 2026
Marks
Java
public static void SortLength(){
String Temp;
Boolean Swap = true;
Integer Count = 0;
while(Count < 14 && Swap){
Swap = false;
for(Integer y = 0; y < 14; y++){
if(DataArray[y].length() > DataArray[y+1].length()){
Temp = DataArray[y];
DataArray[y] = DataArray[y+1];
DataArray[y+1] = Temp;
Swap = true;
}
}
Count++;
}
}
1(f)(ii)
1 mark for calling the 3 procedures in order
1
Example program code
Python
FindWords()
SortLength()
OutputArray()
VB.NET
FindWords()
SortLength()
OutputArray()
Java
FindWords();
SortLength();
OutputArray();
© Cambridge University Press & Assessment 2026
Page 14 of 46
Guidance
9618/43
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Question
1(f)(iii)
Answer
1 mark for screenshot showing inputs and outputs
May/June 2026
Marks
Guidance
1 Ignore output of
array content in
order first.
Allow ordering if
correct for the
data but not
matching
screenshot.
e.g.
© Cambridge University Press & Assessment 2026
Page 15 of 46
9618/43
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Question
2(a)(i)
Answer
1 mark each
• Class header (and end)
• Five attributes with the correct data types
• Constructor header (and end) taking five parameters
• Assigning parameters to each attribute
Example program code
Python
class Character():
def __init__(self, pCharacterName, pColour, pSuperStrength, pFly, pInvisible):
self.__CharacterName = pCharacterName
self.__Colour = pColour
self.__SuperStrength = pSuperStrength
self.__Fly = pFly
self.__Invisible = pInvisible
VB.NET
Class Character
Dim CharacterName As String
Dim Colour As String
Dim SuperStrength As String
Dim Fly As String
Dim Invisible As String
Public Sub New(pCharacterName, pColour, pSuperStrength, pFly, pInvisible)
CharacterName = pCharacterName
Colour = pColour
SuperStrength = pSuperStrength
Fly = pFly
Invisible = pInvisible
End Sub
End Class
© Cambridge University Press & Assessment 2026
Page 16 of 46
May/June 2026
Marks
4
Guidance
9618/43
Question
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Answer
May/June 2026
Marks
Guidance
Java
public class Character {
public String CharacterName;
public String Colour;
public String SuperStrength;
public String Fly;
public String Invisible;
public Character(String pCharacterName, String pColour, String pSuperStrength, String pFly, String
pInvisible){
CharacterName = pCharacterName;
Colour = pColour;
SuperStrength = pSuperStrength;
Fly = pFly;
Invisible = pInvisible;
}
}
© Cambridge University Press & Assessment 2026
Page 17 of 46
9618/43
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Question
2(a)(ii)
Answer
1 mark each
• 1 get method header (and end) with no parameter ...
• … returning correct attribute
• Remaining 4 get methods correct
Example program code
Python
def GetCharacterName(self):
return self.__CharacterName
def GetColour(self):
return self.__Colour
def GetSuperStrength(self):
return self.__SuperStrength
def GetFly(self):
return self.__Fly
def GetInvisible(self):
return self.__Invisible
VB.NET
Public Function GetCharacterName()
Return CharacterName
End Function
Public Function GetColour()
Return Colour
End Function
Public Function GetSuperStrength()
Return SuperStrength
End Function
Public Function GetFly()
Return Fly
End Function
Public Function GetInvisible()
Return Invisible
End Function
© Cambridge University Press & Assessment 2026
Page 18 of 46
May/June 2026
Marks
3
Guidance
9618/43
Question
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Answer
Java
public String GetCharacterName(){
return CharacterName;
}
public String GetColour(){
return Colour;
}
public String GetSuperStrength(){
return SuperStrength;
}
public String GetFly(){
return Fly;
}
public String GetInvisible(){
return Invisible;
}
© Cambridge University Press & Assessment 2026
Page 19 of 46
May/June 2026
Marks
Guidance
9618/43
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Question
2(b)
Answer
1 mark each
• ReadData() header (and end) returning populated array
• Opening file to read and closing file in appropriate place
• Exception handling for file handling including appropriate output
• Looping through each line in file and reading data…
• … (stripping and) splitting file correctly (as appropriate)
• Creating new instance of Character with correct values …
• … storing in array
© Cambridge University Press & Assessment 2026
Page 20 of 46
May/June 2026
Marks
7
Guidance
9618/43
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Question
Answer
May/June 2026
Marks
Example program code
Python
def ReadData():
AllCharacters = []
try:
with open("Characters.txt") as TheFile:
for Line in TheFile:
Line = Line.strip()
Line = Line.split(",")
AllCharacters.append(Character(Line[0],Line[1],Line[2],Line[3],Line[4]))
except:
print("Cannot open file")
return AllCharacters
VB.NET
Public Function ReadData()
Dim AllCharacters(14) As Character
Dim Line(4) As String
Dim Count As Integer = 0
Try
Dim FileReader As New System.IO.StreamReader("Characters.txt")
While Not FileReader.EndOfStream
Line = (FileReader.ReadLine()).Split(",")
AllCharacters(Count) = New Character(Line(0), Line(1), Line(2), Line(3), Line(4))
Count = Count + 1
End While
FileReader.Close()
Catch ex As Exception
Console.WriteLine("Cannot open or read from file")
End Try
Return AllCharacters
End Function
© Cambridge University Press & Assessment 2026
Page 21 of 46
Guidance
9618/43
Question
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Answer
May/June 2026
Marks
Java
public static Character[] ReadData(){
Character[] AllCharacters = new Character[15];
try{
Scanner Scanner1 = new Scanner(new File("Characters.txt"));
String[] Line = new String[5];
Integer Count = 0;
while(Scanner1.hasNextLine()){
Line = Scanner1.nextLine().split(",");
AllCharacters[Count] = new Character(Line[0],Line[1],Line[2],Line[3], Line[4]);
Count++;
}
Scanner1.close();
} catch(FileNotFoundException ex){
System.out.println("No file found");
}
return AllCharacters;
}
© Cambridge University Press & Assessment 2026
Page 22 of 46
Guidance
9618/43
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Question
2(c)
Answer
1 mark each
• Procedure header (and end) taking array parameter and outputting character data using get
methods
• Looping through all characters and outputting data on same line …
• … in correct format
© Cambridge University Press & Assessment 2026
Page 23 of 46
May/June 2026
Marks
3
Guidance
9618/43
Question
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Answer
May/June 2026
Marks
Guidance
Example program code
Python
def OutputCharacters(CharacterArray):
for Item in CharacterArray:
print("Name: ", Item.GetCharacterName(), " Colour: ", Item.GetColour(), " Super Strength: ",
Item.GetSuperStrength(), " Fly: ", Item.GetFly(), " Invisible: ", Item.GetInvisible())
VB.NET
Public Sub OutputCharacters(CharacterArray() As Character)
Dim Count As Integer = 0
While (Not (CharacterArray(Count) Is Nothing))
Console.WriteLine("Name: " & CharacterArray(Count).GetCharacterName() & " Colour: " &
CharacterArray(Count).GetColour() & " Super strength: " & CharacterArray(Count).GetSuperStrength() & " Fly:
" & CharacterArray(Count).GetFly() & " Invisible: " & CharacterArray(Count).GetInvisible())
Count = Count + 1
End While
End Sub
Java
public static void OutputCharacters(Character[] CharacterArray){
System.out.println("Remaining characters: ");
Integer Count = 0;
while(CharacterArray[Count] != null){
System.out.println("Name: " + CharacterArray[Count].GetCharacterName() + " Colour: " +
CharacterArray[Count].GetColour() + " Super strength: " + CharacterArray[Count].GetSuperStrength() + " Fly:
" + CharacterArray[Count].GetFly() + " Invisible: " + CharacterArray[Count].GetInvisible());
Count++;
}
}
© Cambridge University Press & Assessment 2026
Page 24 of 46
9618/43
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Question
2(d)(i)
May/June 2026
Answer
Marks
1 mark each
• Calling ReadData() and storing returned array
• Calling OutputCharacters() with returned array
2
Example program code
Python
CharacterOptions = ReadData()
OutputCharacters(CharacterOptions)
VB.NET
Dim CharacterOptions(19) As Character
CharacterOptions = ReadData()
OutputCharacters(CharacterOptions)
Java
Character[] CharacterOptions = ReadData();
OutputCharacters(CharacterOptions);
2(d)(ii)
1 mark for screenshot showing all characters output (in correct format)
e.g.
© Cambridge University Press & Assessment 2026
Page 25 of 46
1
Guidance
9618/43
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Question
2(e)(i)
Answer
1 mark each
• Prompt and input for two criteria …
• … taking input as two separate inputs // each in one input and splitting appropriately
• Looping through each character and comparing attribute to one choice…
• … repeating for a second choice … (could be AND in if statement)
• … storing matching characters in new array // removing characters from the list // other
appropriate method of limiting/identifying
• Counting and outputting the number of characters
• Calling OutputCharacters() with updated array
• Using get methods correctly throughout
© Cambridge University Press & Assessment 2026
Page 26 of 46
May/June 2026
Marks
8
Guidance
9618/43
Question
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Answer
May/June 2026
Marks
Guidance
Example program code
Python
print("You can use 2 choices to limit the characters available")
for x in range(2):
TempArray = []
print("Choice ", x+1)
TheOption = int(input("Enter 1 to select a colour, 2 for strength, 3 for fly and 4 for invisibility "))
if(TheOption == 1):
Choice = input("Which colour would you like to select a character ")
for Item in CharacterOptions:
if Item.GetColour() == Choice:
TempArray.append(Item)
CharacterOptions = TempArray
elif TheOption == 2:
Choice = input("Enter 1 to select characters with super strength, anything else for those without
select super strength ")
if Choice == "1":
Choice = "Yes"
else:
Choice = "No"
for Item in CharacterOptions:
if Item.GetSuperStrength() == Choice:
TempArray.append(Item)
CharacterOptions = TempArray
elif TheOption == 3:
Choice = input("Enter 1 to select characters that fly, anything else for those that cannot fly ")
if Choice == "1":
Choice = "Yes"
© Cambridge University Press & Assessment 2026
Page 27 of 46
9618/43
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Question
Answer
May/June 2026
Marks
Guidance
else:
Choice = "No"
for Item in CharacterOptions:
if Item.GetFly() == Choice:
TempArray.append(Item)
CharacterOptions = TempArray
else:
Choice = int(input("Enter 1 to select characters with invisibility, anything else for those without
invisibility "))
if Choice == "1":
Choice = "Yes"
else:
Choice = "No"
for Item in CharacterOptions:
if Item.GetInvisible() == Choice:
TempArray.append(Item)
CharacterOptions = TempArray
NumberCharacters = len(CharacterOptions)
print("There are", NumberCharacters, "characters that match your choice")
OutputCharacters(CharacterOptions)
VB.NET
Console.WriteLine("You can use 2 choices to limit the characters available")
Dim TheOption As String
Dim Choice As String
Dim Count As Integer
Dim TempCount As Integer
© Cambridge University Press & Assessment 2026
Page 28 of 46
9618/43
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Question
Answer
May/June 2026
Marks
Guidance
For x = 1 To 2
Dim TempArray(20) As Character
TempCount = 0
Console.WriteLine("Choice " & x)
Console.WriteLine("Enter 1 to select a colour, 2 for strength, 3 for fly and 4 for invisibility ")
TheOption = Console.ReadLine()
If TheOption = "1" Then
Console.WriteLine("Which colour would you like to select a character ")
Choice = Console.ReadLine()
Count = 0
While (Not (CharacterOptions(Count) Is Nothing))
If (CharacterOptions(Count).GetColour() = Choice) Then
TempArray(TempCount) = CharacterOptions(Count)
TempCount = TempCount + 1
End If
Count = Count + 1
End While
CharacterOptions = TempArray
ElseIf TheOption = "2" Then
Console.WriteLine("Enter 1 to select characters with super strength, anything else for those
without select super strength ")
Choice = Console.ReadLine()
Count = 0
If Choice = "1" Then
Choice = "Yes"
Else
Choice = "No"
End If
© Cambridge University Press & Assessment 2026
Page 29 of 46
9618/43
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Question
Answer
May/June 2026
Marks
Guidance
While (Not (CharacterOptions(Count) Is Nothing))
If (CharacterOptions(Count).GetSuperStrength() = Choice) Then
TempArray(TempCount) = CharacterOptions(Count)
TempCount = TempCount + 1
End If
Count = Count + 1
End While
CharacterOptions = TempArray
ElseIf TheOption = "3" Then
Console.WriteLine("Enter 1 to select characters that fly, anything else for those that cannot fly
")
Choice = Console.ReadLine()
Count = 0
If Choice = "1" Then
Choice = "Yes"
Else
Choice = "No"
End If
While (Not (CharacterOptions(Count) Is Nothing))
If (CharacterOptions(Count).GetFly() = Choice) Then
TempArray(TempCount) = CharacterOptions(Count)
TempCount = TempCount + 1
End If
Count = Count + 1
End While
CharacterOptions = TempArray
Else
Console.WriteLine("Enter 1 to select characters with invisibility, anything else for those without
invisibility ")
Choice = Console.ReadLine()
Count = 0
© Cambridge University Press & Assessment 2026
Page 30 of 46
9618/43
Question
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Answer
May/June 2026
Marks
If Choice = "1" Then
Choice = "Yes"
Else
Choice = "No"
End If
While (Not (CharacterOptions(Count) Is Nothing))
If (CharacterOptions(Count).GetInvisible() = Choice) Then
TempArray(TempCount) = CharacterOptions(Count)
TempCount = TempCount + 1
End If
Count = Count + 1
End While
CharacterOptions = TempArray
End If
Next
Console.WriteLine("There are " & TempCount & " characters")
OutputCharacters(CharacterOptions)
Java
System.out.println("You can use 2 choices to limit the characters available");
String TheOption;
String Choice;
Integer Count;
Integer TempCount = 0;
for(Integer x = 1; x < 3; x++){
Character[] TempArray = new Character[20];
TempCount = 0;
System.out.println("Choice" + x);
System.out.println("Enter 1 to select a colour, 2 for strength, 3 for fly and 4 for
invisibility ");
TheOption = Scanner1.nextLine();
if(TheOption.equals("1")){
System.out.println("Which colour would you like to select a character ");
Choice = Scanner1.nextLine();
Count = 0;
© Cambridge University Press & Assessment 2026
Page 31 of 46
Guidance
9618/43
Question
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Answer
May/June 2026
Marks
Guidance
while(CharacterOptions[Count] != null){
if ((CharacterOptions[Count].GetColour()).equals(Choice)){
TempArray[TempCount] = CharacterOptions[Count];
TempCount++;
}
Count++;
}
CharacterOptions = TempArray;
}else if(TheOption.equals("2")){
System.out.println("Enter 1 to select characters with super strength, anything else for
those without select super strength ");
Choice = Scanner1.nextLine();
if(Choice.equals("1")){
Choice = "Yes";
}else{
Choice = "No";
}
Count = 0;
while(CharacterOptions[Count] != null){
if ((CharacterOptions[Count].GetSuperStrength()).equals(Choice)){
TempArray[TempCount] = CharacterOptions[Count];
TempCount++;
}
Count++;
}
CharacterOptions = TempArray;
}else if(TheOption.equals("3")){
System.out.println("Enter 1 to select characters that fly, anything else for those that
cannot fly ");
Choice = Scanner1.nextLine();
if(Choice.equals("1")){
Choice = "Yes";
}else{
Choice = "No";
}
Count = 0;
© Cambridge University Press & Assessment 2026
Page 32 of 46
9618/43
Question
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Answer
May/June 2026
Marks
Guidance
while(CharacterOptions[Count] != null){
if ((CharacterOptions[Count].GetFly()).equals(Choice)){
TempArray[TempCount] = CharacterOptions[Count];
TempCount++;
}
Count++;
}
CharacterOptions = TempArray;
}else{
System.out.println("Enter 1 to select characters with invisibility, anything else for those
without invisibility ");
Choice = Scanner1.nextLine();
if(Choice.equals("1")){
Choice = "Yes";
}else{
Choice = "No";
}
Count = 0;
while(CharacterOptions[Count] != null){
if ((CharacterOptions[Count].GetInvisible()).equals(Choice)){
TempArray[TempCount] = CharacterOptions[Count];
TempCount++;
}
Count++;
}
CharacterOptions = TempArray;
}
}
System.out.println("Number of characters " + TempCount);
OutputCharacters(CharacterOptions);
© Cambridge University Press & Assessment 2026
Page 33 of 46
9618/43
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Question
2(e)(ii)
Answer
1 mark for screenshot showing correct inputs and outputs
e.g.
© Cambridge University Press & Assessment 2026
Page 34 of 46
May/June 2026
Marks
1
Guidance
9618/43
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Question
3(a)
Answer
1 mark each
• Global array with space for 100 3 elements …
• … all initialised to –1
• TreeRootPointer to –1 and FirstFreeNodePointer initialised to 0
Example program code
Python
for x in range(100):
BinaryTree.append([-1,-1,-1])
TreeRootPointer = -1
FirstFreeNodePointer = 0
VB.NET
Dim BinaryTree(100, 3) As Integer
Dim FirstFreeNodePointer As Integer
Dim TreeRootPointer As Integer
Sub Main()
For x = 0 To 99
BinaryTree(x, 0) = -1
BinaryTree(x, 1) = -1
BinaryTree(x, 2) = -1
Next
TreeRootPointer = -1
FirstFreeNodePointer = 0
End Sub
Java
for(Integer x = 0; x <
BinaryTree[x][0] =
BinaryTree[x][1] =
BinaryTree[x][2] =
}
TreeRootPointer = -1;
FirstFreeNodePointer =
100; x++){
-1;
-1;
-1;
0;
© Cambridge University Press & Assessment 2026
Page 35 of 46
May/June 2026
Marks
3
Guidance
9618/43
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Question
Answer
3(b)
1 mark each to max 7
• Procedure header (and end) take integer parameter and incrementing FirstFreeNodePointer
• Checking if tree is empty, storing in first element and updating root pointer
• Checking if the tree is full and outputting message
• (if not full) stores the data in FirstFreeNodePointer with parameter (and pointers –1)
• Comparing to root pointer …
• … repeating with left pointer if less than
• … repeating with right pointer if greater than
• … repeating until leaf node found …
• … updating correct parent node pointer to new node
© Cambridge University Press & Assessment 2026
Page 36 of 46
May/June 2026
Marks
7
Guidance
9618/43
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Question
Answer
Example program code
Python
def AddNode(NodeData):
global FirstFreeNodePointer
global TreeRootPointer
if FirstFreeNodePointer <= 99:
BinaryTree[FirstFreeNodePointer][0] = -1
BinaryTree[FirstFreeNodePointer][1] = NodeData
BinaryTree[FirstFreeNodePointer][2] = -1
if TreeRootPointer == -1:
TreeRootPointer = 0
else:
Placed = False
CurrentNode = TreeRootPointer
while Placed == False:
if NodeData < BinaryTree[CurrentNode][1]:
if BinaryTree[CurrentNode][0] == -1:
BinaryTree[CurrentNode][0] = FirstFreeNodePointer
Placed = True
else:
CurrentNode = BinaryTree[CurrentNode][0]
else:
if BinaryTree[CurrentNode][2] == -1:
BinaryTree[CurrentNode][2] = FirstFreeNodePointer
Placed = True
else:
CurrentNode = BinaryTree[CurrentNode][2]
FirstFreeNodePointer = FirstFreeNodePointer + 1
else:
print("The tree is full")
© Cambridge University Press & Assessment 2026
Page 37 of 46
May/June 2026
Marks
Guidance
9618/43
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Question
Answer
VB.NET
Sub AddNode(NodeData)
If FirstFreeNodePointer <= 99 Then
BinaryTree(FirstFreeNodePointer, 0) = -1
BinaryTree(FirstFreeNodePointer, 1) = NodeData
BinaryTree(FirstFreeNodePointer, 2) = -1
If (TreeRootPointer = -1) Then
TreeRootPointer = 0
Else
Dim Placed As Boolean = False
Dim CurrentNode As Integer = TreeRootPointer
While (Placed = False)
If (NodeData < BinaryTree(CurrentNode, 1)) Then
If (BinaryTree(CurrentNode, 0) = -1) Then
BinaryTree(CurrentNode, 0) = FirstFreeNodePointer
Placed = True
Else
CurrentNode = BinaryTree(CurrentNode, 0)
End If
Else
If (BinaryTree(CurrentNode, 2) = -1) Then
BinaryTree(CurrentNode, 2) = FirstFreeNodePointer
Placed = True
Else
CurrentNode = BinaryTree(CurrentNode, 2)
End If
End If
End While
End If
FirstFreeNodePointer = FirstFreeNodePointer + 1
Else
Console.WriteLine("The tree is full")
End If
End Sub
© Cambridge University Press & Assessment 2026
Page 38 of 46
May/June 2026
Marks
Guidance
9618/43
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Question
Answer
Java
public static void AddNode(Integer NodeData){
if(FirstFreeNodePointer <= 99){
BinaryTree[FirstFreeNodePointer][0] = -1;
BinaryTree[FirstFreeNodePointer][1] = NodeData;
BinaryTree[FirstFreeNodePointer][2] = -1;
if(TreeRootPointer == -1){
TreeRootPointer = 0;
}else{
boolean Placed = false;
Integer CurrentNode = TreeRootPointer;
while(Placed == false){
if(NodeData < BinaryTree[CurrentNode][1]){
if(BinaryTree[CurrentNode][0] == -1){
BinaryTree[CurrentNode][0] = FirstFreeNodePointer;
Placed = true;
}else{
CurrentNode = BinaryTree[CurrentNode][0];
}
}else{
if(BinaryTree[CurrentNode][2] == -1){
BinaryTree[CurrentNode][2] = FirstFreeNodePointer;
Placed = true;
}else{
CurrentNode = BinaryTree[CurrentNode][2];
}
}
}
}
FirstFreeNodePointer= FirstFreeNodePointer + 1;
© Cambridge University Press & Assessment 2026
Page 39 of 46
May/June 2026
Marks
Guidance
9618/43
Cambridge International AS & A Level – Mark Scheme
PUBLISHED
Question
Answer
May/June 2026
Marks
Guidance
}else{
System.out.println("The tree is full");
}
}
3(c)
1 mark each
• Procedure header (and end) looping 10 times
• Outputting array data in correct format
Example program code
Python
def OutputArray():
for x in range(10):
print(BinaryTree[x][0], "
2
", BinaryTree[x][1], "
", BinaryTree[x][2])
VB.NET
Sub OutputArray()
For x = 0 To 9
Console.WriteLine(BinaryTree(x, 0) & "
" & BinaryTree(x, 1) & "
" & BinaryTree(x, 2))
Next
End Sub
Java
public static void OutputArray(){
for(Integer x = 0; x < 10; x++){
System.out.println(BinaryTree[x][0] + "
" + BinaryTree[x][1] + "
" + BinaryTree[x][2]);
}
}
© Cambridge University Press & Assessment 2026
Page 40 of 46