A Level Computer Science 9618 Paper 43, May/June 2026

Question paper and mark scheme75 marks3 questions

Solve it on ExamPal

Practise

Untimed. Write on the paper and check as you go.

Start

Exam

Timed, with a clock you set, like sitting the real paper.

Start

Opens full screen.

Opening the question paper

Read as textThe questions and the mark scheme as plain text. Easier to read on a phone.

Question paper

9618/43 · May/June 2026

Download PDF
1

A program stores 15 strings in the 1D array DataArray

a

Write program code to declare the global 1D array DataArray with space for 15 string elements. Save your program as Question1_J26. Copy and paste the program code into 1(a) in the evidence document.

[1]
b

The procedure CreateArray() takes 15 strings as input from the user. Each input is converted to lower case and stored in DataArray in the order input. Write program code for CreateArray() Save your program. Copy and paste the program code into 1(b) in the evidence document.

[4]
c

The procedure OutputArray() outputs the data in each element in DataArray on one line with a space between each element. Write program code for OutputArray() Save your program. Copy and paste the program code into 1(c) in the evidence document.

[2]
d(i)

Write program code for the main program to call CreateArray() and then OutputArray() Save your program. Copy and paste the program code into 1(d)(i) in the evidence document.

[1]
d(ii)

Test your program. Enter the following data for the inputs in the order given: 1 One 2 TWO three ?? house 99987 popping green eleven 12 Twenty THIRTY 16 Take a screenshot of the output(s). Save your program. Copy and paste the screenshot into 1(d)(ii) in the evidence document.

[1]
e

The procedure FindWords() takes a string as input from the user and converts it to lower case. The procedure counts and outputs the number of times the input is stored in DataArray Write program code for FindWords(). Do not use an in-built function to count the number of times the input is stored in DataArray Save your program. Copy and paste the program code into 1(e) in the evidence document.

[5]
f(i)

The procedure SortLength() uses a bubble sort to order the elements in DataArray into ascending order by the length of each string. The bubble sort needs to be efficient and stop iterating as soon as it identifies that DataArray is in the correct order. Write program code for SortLength(). Do not use an in-built function to sort the array or check if the array is in the correct order. Save your program. Copy and paste the program code into 1(f)(i) in the evidence document.

[5]
f(ii)

Write program code to extend the main program by calling FindWords() then SortLength() then OutputArray() Save your program. Copy and paste the program code into 1(f)(ii) in the evidence document.

[1]
f(iii)

Test your program. Enter the following data to be stored in the array in the order given: one One 1 three three One house 99987 popping green eleven One Twenty THIRTY One Enter "one" as the string to find in the array. Take a screenshot of the output(s). Save your program. Copy and paste the screenshot into 1(f)(iii) in the evidence document.

[1]
2

A prototype for a game is being developed using Object-Oriented Programming (OOP). The game has a set of characters that have data stored about their characteristics, for example if the character can fly or not fly. A user has to select their requirements, for example a character that can fly, and the program will output the characters that meet the user’s requirements. The class Character stores the data about the characters. The attributes are public. Character CharacterName : String - stores the character's name Colour : String - stores the colour of the character, for example "Green" SuperStrength : String - stores whether the character has super strength ("Yes") or not ("No") Fly : String - stores whether the character can fly ("Yes") or not ("No") Invisible : String - stores whether the character can become invisible ("Yes") or not ("No") Constructor() - initialises the attributes to its parameter values GetCharacterName() - returns CharacterName GetColour() - returns Colour GetSuperStrength() - returns SuperStrength GetFly() - returns Fly GetInvisible() - returns Invisible

a(i)

Write program code to declare the class Character and its constructor. Use your programming language appropriate constructor. If you are writing in Python, include attribute declarations using comments. Save your program as Question2_J26. Copy and paste the program code into 2(a)(i) in the evidence document.

[4]
a(ii)

The get methods GetCharacterName(), GetColour(), GetSuperStrength(), GetFly() and GetInvisible() each return the appropriate attribute. Write program code for GetCharacterName(), GetColour(), GetSuperStrength(), GetFly() and GetInvisible() Save your program. Copy and paste the program code into 2(a)(ii) in the evidence document.

[3]
b

The text file Characters.txt stores data about 15 characters. Each character is on a new line in the file. The data is stored in the order: Character name, colour, super strength, fly, invisible. Each value is separated by a comma. For example, the first line in the file is: Jet,Black,Yes,No,No The name of the character is Jet. The colour of the character is Black. The character has super strength. The character cannot fly. The character cannot become invisible. The function ReadData(): • opens the file Characters.txt and reads in the data • creates a new Character object for each character in the file • stores each Character object in a local array • returns the populated array. The function uses exception handling when opening and reading from the file. Write program code for ReadData() Save your program. Copy and paste the program code into 2(b) in the evidence document.

[7]
c

The procedure OutputCharacters() takes an array of Character objects as a parameter. The procedure outputs the data for each character on a new line, in the format: Name: <Character name> Colour: <Colour> Super strength: <Super strength> Fly: <Fly> Invisible: <Invisible> For example: Name: Jet Colour: Black Super strength: Yes Fly: No Invisible: No Write program code for OutputCharacters() Save your program. Copy and paste the program code into 2(c) in the evidence document.

[3]
d(i)

The main program calls ReadData() and then OutputCharacters() with the returned array. Write program code for the main program. Save your program. Copy and paste the program code into 2(d)(i) in the evidence document.

[2]
d(ii)

Test your program Take a screenshot of the output(s). Save your program. Copy and paste the screenshot into 2(d)(ii) in the evidence document.

[1]
e(i)

The main program needs to give the user two choices to limit the characters that they can choose from. For example, they could choose to only see characters that are green and that can fly. The main program needs extending to: • prompt the user to enter two criteria and take both as input. For example, the colour green and that they have super strength. • create a new array with only the characters that meet both of the criteria. You do not need to validate the inputs. You can assume that each criteria that the user inputs will be for a different characteristic of the character. The main program should then: • output the number of characters that meet both criteria • use OutputCharacters() to output the characters that meet both criteria. Write program code to extend the main program as described. Save your program. Copy and paste the program code into 2(e)(i) in the evidence document.

[8]
e(ii)

Test your program. Enter the options given when prompted: first choice is characters with the colour black second choice is characters that can fly. Take a screenshot of the output(s). Save your program. Copy and paste the screenshot into 2(e)(ii) in the evidence document.

[1]
3

A binary tree is designed to store up to 100 positive integers. The binary tree stores data in ascending numerical order. The data in the binary tree is created as a global 2D array with the identifier BinaryTree Each node has three values: • a pointer to the array index with the left node • the integer data • a pointer to the array index with the right node. A null pointer is represented by the integer –1. All nodes are initialised with the null data –1 The table has example data for a binary tree: index | left pointer | data | right pointer 0 | 1 | 20 | 2 1 | 4 | 10 | –1 2 | 3 | 26 | –1 3 | –1 | 22 | –1 4 | –1 | 8 | –1 The binary tree has two global pointers: • TreeRootPointer, initialised to –1, stores the index of the root node of the binary tree • FirstFreeNodePointer, initialised to 0, stores the index of the first node that does not store any data. Data cannot be removed or replaced from the tree. FirstFreeNodePointer is incremented each time a node is added to the binary tree.

Figure 1 of 1 for question 3
a

The main program initialises all 100 nodes, TreeRootPointer and FirstFreeNodePointer Write program code for the main program. Save your program as Question3_J26. Copy and paste the program code into 3(a) in the evidence document.

[3]
b

The procedure AddNode(): • takes an integer parameter to be stored as the data in a new node • stores the data in the first element and updates the root pointer when the tree is empty • outputs "The tree is full" if the tree is full • stores the data in the next free node if the tree is not full, then: ◦ checks if the data is less than or greater than the root node ◦ follows the left or right pointer(s) repeatedly until it reaches the appropriate leaf node ◦ updates the appropriate parent node pointer to the new node. Write program code for AddNode() Save your program. Copy and paste the program code into 3(b) in the evidence document.

[7]
c

The procedure OutputArray() outputs the content of the first 10 elements in the binary tree. Each node is output on one line in the format: <left pointer> <data> <right pointer> For example: 1 20 4 Write program code for OutputArray() Save your program. Copy and paste the program code into 3(c) in the evidence document.

[2]
d(i)

Write program code to extend the main program to: • take 10 integers as input • store each input in the binary tree in the order they are entered using the appropriate procedure • output the content of the binary tree using OutputArray() Save your program. Copy and paste the program code into 3(d)(i) in the evidence document.

[3]
d(ii)

Test your program. Enter the following numbers in the order shown: 50 26 120 236 2 16 67 49 165 15 Take a screenshot of the output(s). Save your program. Copy and paste the screenshot into 3(d)(ii) in the evidence document.

[1]
e(i)

An in-order tree traversal outputs the contents of the binary tree in ascending numerical order by: • visiting the left node • output the data • visiting the right node. For example, an in-order traversal on the following binary tree will output: 5 12 18 20 26 20 12 26 5 18 The recursive procedure InOrder(): • takes the root pointer as a parameter • makes a recursive call with the left pointer as the parameter if the left pointer is not null • outputs the data at the parameter • makes a recursive call with the right pointer as the parameter if the right pointer is not null. Write program code for InOrder() Save your program. Copy and paste the program code into 3(e)(i) in the evidence document.

[7]
e(ii)

Write program code to extend the main program to call InOrder() Save your program. Copy and paste the program code into 3(e)(ii) in the evidence document.

[1]
e(iii)

Test your program. Enter the following numbers in the order given: 50 26 120 236 2 16 67 49 165 15 Take a screenshot of the output(s). Save your program. Copy and paste the screenshot into 3(e)(iii) in the evidence document.

[1]

Mark scheme

9618/43 · May/June 2026

Download PDF

1a · 1 mark

  • 1 mark

    1D array (of 15 strings)

1b · 4 marks

  • 1 mark

    Procedure header (and end)

  • 1 mark

    Taking 15 strings as input

  • 1 mark

    … converting to lower case

  • 1 mark

    … storing in array

1c · 2 marks

  • 1 mark

    Procedure header (and end) and outputting all data

  • 1 mark

    … on one line with a space between each element

1d(i) · 1 mark

  • 1 mark

    calling both procedures in the given order

1d(ii) · 1 mark

  • 1 mark

    showing the 15 inputs and all data output on the same line

1e · 5 marks

  • 1 mark

    Procedure header (and end) taking string as input and converting to lower

  • 1 mark

    Looping through all elements in the array

  • 1 mark

    … comparing to input

  • 1 mark

    … counting number of times it occurs

  • 1 mark

    Outputting final count

1f(i) · 5 marks

  • 1 mark

    Procedure header (and end) and iterating through each element (first loop)

  • 1 mark

    Inner loop

  • 1 mark

    Stopping the loop when in order (any method)

  • 1 mark

    Comparing by length …

  • 1 mark

    … and swapping correctly

1f(ii) · 1 mark

  • 1 mark

    calling the 3 procedures in order

1f(iii) · 1 mark

  • 1 mark

    screenshot showing inputs and outputs

2a(i) · 4 marks

  • 1 mark

    Class header (and end)

  • 1 mark

    Five attributes with the correct data types

  • 1 mark

    Constructor header (and end) taking five parameters

  • 1 mark

    Assigning parameters to each attribute

2a(ii) · 3 marks

  • 1 mark

    1 get method header (and end) with no parameter ...

  • 1 mark

    … returning correct attribute

  • 1 mark

    Remaining 4 get methods correct

2b · 7 marks

  • 1 mark

    ReadData() header (and end) returning populated array

  • 1 mark

    Opening file to read and closing file in appropriate place

  • 1 mark

    Exception handling for file handling including appropriate output

  • 1 mark

    Looping through each line in file and reading data…

  • 1 mark

    … (stripping and) splitting file correctly (as appropriate)

  • 1 mark

    Creating new instance of Character with correct values …

  • 1 mark

    … storing in array

2c · 3 marks

  • 1 mark

    Procedure header (and end) taking array parameter and outputting character data using get methods

  • 1 mark

    Looping through all characters and outputting data on same line …

  • 1 mark

    … in correct format

2d(i) · 2 marks

  • 1 mark

    Calling ReadData() and storing returned array

  • 1 mark

    Calling OutputCharacters() with returned array

2d(ii) · 1 mark

  • 1 mark

    screenshot showing all characters output (in correct format)

2e(i) · 8 marks

  • 1 mark

    Prompt and input for two criteria …

  • 1 mark

    … taking input as two separate inputs // each in one input and splitting appropriately

  • 1 mark

    Looping through each character and comparing attribute to one choice…

  • 1 mark

    … repeating for a second choice … (could be AND in if statement)

  • 1 mark

    … storing matching characters in new array // removing characters from the list // other appropriate method of limiting/identifying

  • 1 mark

    Counting and outputting the number of characters

  • 1 mark

    Calling OutputCharacters() with updated array

  • 1 mark

    Using get methods correctly throughout

2e(ii) · 1 mark

  • 1 mark

    screenshot showing correct inputs and outputs

3a · 3 marks

  • 1 mark

    Global array with space for 100  3 elements …

  • 1 mark

    … all initialised to –1

  • 1 mark

    TreeRootPointer to –1 and FirstFreeNodePointer initialised to 0

3b · 7 marks

  • 1 mark

    Procedure header (and end) take integer parameter and incrementing FirstFreeNodePointer

  • 1 mark

    Checking if tree is empty, storing in first element and updating root pointer

  • 1 mark

    Checking if the tree is full and outputting message

  • 1 mark

    (if not full) stores the data in FirstFreeNodePointer with parameter (and pointers –1)

  • 1 mark

    Comparing to root pointer …

  • 1 mark

    … repeating with left pointer if less than

  • 1 mark

    … repeating with right pointer if greater than

  • 1 mark

    … repeating until leaf node found …

  • 1 mark

    … updating correct parent node pointer to new node

3c · 2 marks

  • 1 mark

    Procedure header (and end) looping 10 times

  • 1 mark

    Outputting array data in correct format

3d(i) · 3 marks

  • 1 mark

    Taking 10 numbers as input …

  • 1 mark

    … calling AddNode() with each value

  • 1 mark

    Calling OutputArray()

3d(ii) · 1 mark

  • 1 mark

    screenshot show array contents

3e(i) · 7 marks

  • 1 mark

    Recursive procedure InOrder() header and end with parameter

  • 1 mark

    Checking if left pointer is null …

  • 1 mark

    … if not, recursive call with left pointer

  • 1 mark

    Outputting data at parameter

  • 1 mark

    Checking if right pointer is null …

  • 1 mark

    … if not, recursive call with right pointer

  • 1 mark

    Correct order

3e(ii) · 1 mark

  • 1 mark

    calling InOrder() with root pointer

3e(iii) · 1 mark

  • 1 mark

    screenshot showing data input and output in correct order

Questions

  1. 1
    Question 121 marks
    Mark scheme ›
  2. 2
    Question 229 marks
    Mark scheme ›
  3. 3
    Question 325 marks
    Mark scheme ›

More 9618 papers

Other papers from May/June 2026

Solve it on ExamPalStart