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

Question paper and mark scheme75 marks6 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/22 · May/June 2026

Download PDF
1

Refer to the insert for the list of pseudocode functions and operators. 1 A program is being developed to control a simple alarm system to be used in a house. The alarm has a control panel with a keypad and a screen to display text. The keypad consists of 36 character keys: • 26 upper-case letter keys, allowing A to Z to be entered • 10 digit keys, allowing 0 to 9 to be entered.

a(i)

(a) When the alarm system is initially installed, a password must be created. When the password is initially entered, it is checked to ensure that it follows a set of validation rules. It is then permanently stored in the alarm system. For a password to be valid it must follow these validation rules: Rule 1: contain between six and eight characters inclusive. Rule 2: contain at least one letter and one digit. Rule 3: each character can only occur once. The global variable Pass is used to store the password entered. (i) Complete the pseudocode to declare the variable to be used to hold the password. DECLARE Pass : ....................

[1]
a(ii)

(ii) Complete the pseudocode to check that a password contains between six and eight characters inclusive (rule 1). IF .................... (Pass) < 6 OR .................... (Pass) > .................... THEN OUTPUT "Error" OUTPUT "The password has to contain between 6 and 8 characters." ENDIF

[2]
a(iii)

(iii) Complete the pseudocode to check that a password entered contains at least one letter and one digit character (rule 2). DECLARE Index : INTEGER DECLARE Character : CHAR DECLARE LetterFlag, DigitFlag : .................... DigitFlag ← FALSE LetterFlag ← .................... FOR Index ← 1 TO .................... (Pass) Character ← .................... (Pass, .................... , ....................) IF .................... (Character) = TRUE THEN DigitFlag ← .................... ELSE LetterFlag ← .................... ENDIF NEXT Index IF .................... (LetterFlag AND DigitFlag) THEN OUTPUT "Error" OUTPUT "Password needs at least one letter and one digit." ENDIF

[7]
b(i)

(b) A state-transition diagram is being created as part of the design process for the module, which will control the alarm system once it has been successfully installed. Two of the states already identified are that the alarm is in: • standby mode • on mode (alarm system is active). (i) Identify two other states that should be part of the state-transition diagram. 1 ........................................................................................................................................ 2 ........................................................................................................................................

[2]
b(ii)

(ii) Two events that will cause a change of state are: • entering the password when the alarm system is in standby mode • entering the password when the alarm system is in on mode. Identify three other events that would cause a change of state in the state-transition diagram for the alarm system. 1 ........................................................................................................................................ 2 ........................................................................................................................................ 3 ........................................................................................................................................

[3]
c

(c) The validation rules from 1(a) are given again: For a password to be valid it must follow these validation rules: Rule 1: contain between six and eight characters inclusive. Rule 2: contain at least one letter and one digit. Rule 3: each character can only occur once. Complete the table with test data that could be used to test the validation rules. Each example of test data given must: • be invalid for the specific rule being tested • be valid for the other two rules not being tested • test a different aspect of the rule being tested. Two of the tests have been completed for you.

rule being testedexample of test datareason for invalid test data
rule 11Apassword is too short
rule 1
rule 2
rule 2
rule 3PASSWRD2letters are repeated
rule 3
rule 3
[3]
d

(d) Five outcomes that could be produced at the design stage in the program development lifecycle include: • state-transition diagrams • pseudocode • test strategy • test plan • structured English. Identify three other outcomes that could be produced at the design stage. 1 ................................................................................................................................................ 2 ................................................................................................................................................ 3 ................................................................................................................................................

[3]
e

(e) The design and testing stages are two of the stages in the program development lifecycle used when developing the program to control the alarm system. Identify two other stages in the program development lifecycle. 1 ................................................................................................................................................ 2 ................................................................................................................................................

[2]
f(i)

(f) All the individual modules for the alarm system have now been written, tested and debugged as necessary. All these modules are combined to form the program, and further testing is now needed. (i) Identify this method of testing. .....................................................................................................................................

[1]
f(ii)

(ii) One of the modules does not work as expected when added to the program. Identify and describe a testing method that can be used to address this problem, so that the program can continue to be tested. method .............................................................................................................................. description ......................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ...........................................................................................................................................

[3]
2

2 A new computer system is being developed to help manage a tool hire business. A customer can specify if they want to hire a tool for either half a day or a full day. An abstract model for the new system is required.

a

(a) Explain the purpose of abstraction. ................................................................................................................................................... .............................................................................................................................................

[1]
b

(b) State four items of data that must be stored each time a tool is hired. item 1 ........................................................................................................................................ item 2 ........................................................................................................................................ item 3 ........................................................................................................................................ item 4 ........................................................................................................................................

[2]
c

(c) The computer system will have to process the tool hire data. One process is to cancel a tool hire booking. State two other processes that would be required. process 1 .................................................................................................................................. ................................................................................................................................................... process 2 .................................................................................................................................. ...................................................................................................................................................

[2]
3

3 A computer game uses a text file named WordList.txt containing 10000 words, all in lower case. Each word is unique and is stored on a separate line of the text file. An efficient algorithm is needed to check that a word input by the user is stored in WordList.txt. If the word is found, the line number where the word is stored must be output. If the word is not found, the message "Not Found" must be output. Complete the steps needed to describe the algorithm. Do not include pseudocode statements in your answer. The first three steps have been completed for you. step 1: set line counter to 0 step 2: input a word step 3: convert the word to lower case .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... ..........................................................................................................................................................

[6]
4

4 A desktop web browser stores the history of web addresses visited. The web browser uses a back button and forward button to move between web pages recently visited. Two stacks are used when each of these buttons are clicked: • back stack • forward stack. The back button is clicked to return to a previously visited web page. The back button operates as follows: • The web address currently being displayed by the browser is pushed onto the forward stack. • The web address from the top of the back stack is popped. • The web address popped is loaded by the web browser. The forward button is clicked to revisit a web page previously visited. The forward button operates as follows: • The web address currently being displayed by the browser is pushed onto the back stack. • The web address from the top of the forward stack is popped. • The web address popped is loaded by the web browser. The current state of the two stacks:

back stackforward stack
www.333.corp← TOS
www.111.home
www.zzz.corp← TOSwww.999.corp
www.aaa.homewww.222.me
www.ccc.my

The top of stack pointer is represented by TOS. The current web address being displayed by the web browser is: www.bbb.home The browsing session continues; the buttons are clicked in sequence in the three groups: group 1: back button group 2: forward button group 3: forward button forward button forward button

a

(a) Complete the diagrams to show the state of both stacks after each group of operations has been performed. Note: you must include the top of stack pointer (TOS) and the current web address being displayed for each group diagram. after group 1 back stack forward stack Web address currently displayed in the web browser: ............................................................. after group 2 back stack forward stack Web address currently displayed in the web browser: ............................................................. after group 3 back stack forward stack Web address currently displayed in the web browser: .............................................................

[6]
b

(b) A stack is an Abstract Data Type (ADT) Identify one other ADT and describe two features of the ADT. ADT ........................................................................................................................................... feature 1 ................................................................................................................................... ................................................................................................................................................... feature 2 ................................................................................................................................... ...................................................................................................................................................

[3]
5

5 A programmer has defined a global 1D array Numbers of type INTEGER, which can store 1000 integers. The lower bound of the array Numbers is set to 1. Each element of the array has been initialised with a random integer in the range 200 to 99999. The programmer has written a bubble sort algorithm to sort the array Numbers into ascending order. Study algorithm A. Assume all the variables have been correctly declared. algorithm A: FOR LoopCounter ← 1 TO 999 //Outer Loop FOR Index ← 1 TO 999 //Inner Loop IF Numbers[Index] > Numbers[Index + 1] THEN //Start of block to swap neighbouring elements in the array Temp ← Numbers[Index] Numbers[Index] ← Numbers[Index + 1] Numbers[Index + 1] ← Temp //End of block to swap neighbouring elements in the array ENDIF NEXT Index NEXT LoopCounter

a

(a) Describe the change that would have to be made to the bubble sort algorithm (algorithm A) so that the Numbers array would be sorted into descending order. ................................................................................................................................................... .............................................................................................................................................

[1]
b(i)

(b) The programmer rewrites the bubble sort algorithm to make it more efficient. Study algorithm B. Assume all the variables have been correctly declared. algorithm B: Boundary ← 999 REPEAT //Outer Loop NoSwaps ← TRUE FOR Index ← 1 TO Boundary //Inner Loop IF Numbers[Index] > Numbers[Index + 1] THEN //Start of block to swap neighbouring elements in the array Temp ← Numbers[Index] Numbers[Index] ← Numbers[Index + 1] Numbers[Index + 1] ← Temp //End of block to swap neighbouring elements in the array NoSwaps ← FALSE ENDIF NEXT Index Boundary ← Boundary - 1 UNTIL NoSwaps = TRUE (i) Explain why the second bubble sort algorithm (algorithm B) is more efficient than the first bubble sort algorithm (algorithm A). Your answer must refer to both inner and outer loops. ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... .....................................................................................................................................

[4]
b(ii)

(ii) State the situation that will result in the outer loop iterating for the minimum number of times when the second bubble sort algorithm (algorithm B) is used. ........................................................................................................................................... .....................................................................................................................................

[1]
c(i)

(c) The programmer has defined a new procedure: PROCEDURE Swap(Num1 : INTEGER, Num2 : INTEGER) DECLARE Temp : INTEGER Temp ← Num1 Num1 ← Num2 Num2 ← Temp ENDPROCEDURE The programmer replaces the block of pseudocode in the algorithm that swaps the values in two neighbouring elements in the array with a call to this procedure. The block of code: Temp ← Numbers[Index] Numbers[Index] ← Numbers[Index + 1] Numbers[Index + 1] ← Temp Is replaced by: CALL Swap(Numbers[Index], Numbers[Index + 1]) The Swap() procedure will not work as expected when used in the bubble sort algorithm. (i) Explain why the procedure Swap() will not work as expected. ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... .....................................................................................................................................

[2]
c(ii)

(ii) Write pseudocode to amend the version of the Swap() procedure given so that it will work as expected. The amended version of the Swap() procedure must not use global variables. ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... .....................................................................................................................................

[2]
6

6 A program is being developed to encrypt a message. The following terms are used in the encryption technique to be used:

termdefinition
plain textThe original message before it is encrypted.
cipher textThe encrypted version of the plain text.

The encryption method to be used is based on the algorithm for the Caesar Box Cipher. All plain text messages to be encrypted must be 25 characters in length or less. If a message is less than 25 characters in length, then spaces are added to the end to make the padded plain text the required length. A square grid of five columns and five rows is used. The padded plain text message is put into the grid row by row. The cipher text is obtained by reading the grid column by column. For example: plain text: This is a message The number of characters in the original plain text, including spaces, is 17. plain text with added spaces at the end: This∆is∆a∆message∆∆∆∆∆∆∆∆ The character ∆ is used to indicate a space in the padded plain text. The grid filled, row by row, with the padded plain text. | T | h | i | s | ∆ | | i | s | ∆ | a | ∆ | | m | e | s | s | a | | g | e | ∆ | ∆ | ∆ | | ∆ | ∆ | ∆ | ∆ | ∆ | The cipher text is obtained by reading the grid column by column. cipher text: Timg∆hsee∆i∆s∆∆sas∆∆∆∆a∆∆ The programmer has defined the first program module as:

moduledescription
AddPadding()• user prompt for and input of plain text<br>• check plain text contains between 1 and 25 characters inclusive<br>• re-input of plain text until it contains between 1 and 25 characters<br>• if required, additional space characters are added to the end of the plain text to ensure it contains exactly 25 characters<br>• return of amended plain text
a

(a) Write pseudocode for module AddPadding() ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... ................................................................................................................................................... .............................................................................................................................................

[8]
b(i)

(b) The programmer has defined a global 2D array Grid to be used to create the cipher text. (i) Complete the pseudocode statement used to declare the global 2D array Grid DECLARE ........................................................................................................................... ...........................................................................................................................................

[2]
b(ii)

(ii) The programmer has defined an additional program module as follows:

moduledescription
PopulateGrid()• called with one parameter of type string representing the correctly padded plain text<br>• populate the array Grid using the plain text so that it can be used at a later point to create the cipher text<br>• output the contents of the array Grid so it is displayed row-by-row<br><br>using the original example for the padded plain text:<br>This∆is∆a∆message∆∆∆∆∆∆∆∆<br><br>the output would be:<br>This<br>is a<br>messa<br>ge

Write pseudocode for module PopulateGrid() ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... .....................................................................................................................................

[8]

Mark scheme

9618/22 · May/June 2026

Download PDF

1a(i) · 1 mark

  • 1 mark

    STRING

1a(ii) · 2 marks

  • 1 mark

    Use of LENGTH function twice

  • 1 mark

    Number 8 used in second condition

1a(iii) · 7 marks

  • 1 mark

    DECLARE LetterFlag, DigitFlag: BOOLEAN (1 mark for BOOLEAN)

  • 1 mark

    LetterFlag  FALSE (1 mark for FALSE)

  • 1 mark

    FOR Index  1 TO LENGTH(Pass) (1 mark for LENGTH)

  • 1 mark

    Character  MID(Pass, Index, 1) (1 mark for MID, Index and 1)

  • 1 mark

    IF IS_NUM(Character) = TRUE THEN (1 mark for IS_NUM)

  • 1 mark

    DigitFlag  TRUE ELSE LetterFlag  TRUE (1 mark for both variables being set to TRUE)

  • 1 mark

    IF NOT(LetterFlag AND DigitFlag) THEN (1 mark for NOT)

1b(i) · 2 marks

  • 1 mark

    Sensor activated (mode) / / Intruder/movement detected (mode) // Alert Mode

  • 1 mark

    Alarm sounding // Light flashing (mode) // Alarm activated

  • 1 mark

    Error mode // Power loss detected (mode) // Battery too low mode

  • 1 mark

    Tamper detected (mode) // Lockdown (mode)

  • 1 mark

    Disarm Mode // Maintenance Mode // Password Change Mode // Service Mode

1b(ii) · 3 marks

  • 1 mark

    Movement / pressure (detected)

  • 1 mark

    Window opened / broken (detected)

  • 1 mark

    Door open (detected)

  • 1 mark

    Entering wrong password (repeatedly)

  • 1 mark

    Entering password to enter / exit maintenance mode / silence alarm

  • 1 mark

    Tampering / damaging alarm (system)

  • 1 mark

    Time delay // Time passed after alarm triggered / before alarm activated

  • 1 mark

    Battery charge too low

  • 1 mark

    Pressing panic button

1c · 3 marks

  • 1 mark

    Rule 1 test: 1 mark for one example of test data for rule 1 and appropriate reason (Test data: A string of more than 8 characters that contains both letters and digits, letters upper case, each character only occurs once; Reason: Password is too long)

  • 1 mark

    Rule 2 test: 1 mark for two examples of test data that only breaks rule 2 and appropriate reasons (Contains no digits / Does not contain a digit; Contains no letters / Does not contain a letter)

  • 1 mark

    Rule 3: 1 mark for two examples of test data for rule 3 and appropriate reasons (Only digits are repeated / Digits are repeated; Both characters and digits are repeated / Both digits and letters are repeated)

1d · 3 marks

  • 1 mark

    Structure chart // Problem / Program broken into modules // Modular Diagram

  • 1 mark

    Flowchart

  • 1 mark

    Data Flow Diagram

  • 1 mark

    Identifier / Variable table // Data structure / Record structure (designs)

  • 1 mark

    File structure // Database Design

  • 1 mark

    E-R Diagram

  • 1 mark

    HCI Design // Report Design

  • 1 mark

    Class Diagram // UML Diagram

  • 1 mark

    Programming language to use

1e · 2 marks

  • 1 mark

    Analysis

  • 1 mark

    Coding // Implementation

  • 1 mark

    Maintenance

1f(i) · 1 mark

  • 1 mark

    Integration

1f(ii) · 3 marks

  • 1 mark

    Method: Stub (testing)

  • 1 mark

    Description: A simple / dummy module is written to replace the module (that is not working)

  • 1 mark

    Description: The simple / dummy module will return an expected value / will output a message (to show the module has been called)

2a · 1 mark

  • 1 mark

    To filter out information / data that is not necessary for the task // To keep only information / data that is necessary for the task

2b · 2 marks

  • 1 mark

    First two data items

  • 1 mark

    Further two data items

2c · 2 marks

  • 1 mark

    Input customer details / customer ID / payment details / Tool ID

  • 1 mark

    Search for required tool // Checking if tool returned // Checking if tool available // Searching for dates when tool is available

  • 1 mark

    Record tool booking // Amend Tool booking // Create tool booking // Record when tool returned // Confirm booking

  • 1 mark

    Calculating time when tool has to be returned

  • 1 mark

    Change / check tool status e.g. hired / available / damaged // Prevent same tool being hired twice

  • 1 mark

    Process payment / calculate hire cost

3 · 6 marks

  • 1 mark

    MP 1 (Step 4) Open WordList.txt / File in read mode (and subsequently close)

  • 1 mark

    MP 2 (Step 5) Read the next line from the file in a loop

  • 1 mark

    MP 3 (Step 6) Increment line counter in a loop

  • 1 mark

    MP 4 (Step 7) Check if the line read equals the word (input) in a loop

  • 1 mark

    MP 5 (Step 8) ...If it does output line counter

  • 1 mark

    MP 6 (Step 9) If word not found in file then output "Not Found" after all iterations

  • 1 mark

    MP 7 (Step 10) Otherwise repeat from step 5

4a · 6 marks

  • 1 mark

    Group 1: 1 mark for back stack as shown and TOS position as shown on both stacks

  • 1 mark

    Group 1: 1 mark for forward stack as shown and current web address

  • 1 mark

    Group 2: 1 mark for stacks and correct TOS pointers as shown and current web address

  • 1 mark

    Group 3: 1 mark for back stack as shown and TOS as shown

  • 1 mark

    Group 3: 1 mark for forward stack as shown and TOS as shown

  • 1 mark

    Group 3: 1 mark current web address

4b · 3 marks

  • 1 mark

    Identifying an ADT: Queue / Linked List

  • 1 mark

    First feature of identified ADT

  • 1 mark

    Second feature of identified ADT

5a · 1 mark

  • 1 mark

    The greater than logic operator / > in the selection statement would need to be changed to a less than operator / < (or equivalent code example)

5b(i) · 4 marks

  • 1 mark

    Inner loop MP 1: The inner loop iterates one less time (in algorithm B) each time the outer / repeat loop iterates.

  • 1 mark

    Inner loop MP 2: this is because for each iteration of the outer / repeat loop (in algorithm B) the last / one more element in the Numbers array will be in the correct place.

  • 1 mark

    Outer loop MP 3: The outer / repeat loop (in algorithm B) would stop iterating if no swaps are made / all numbers in array are sorted

  • 1 mark

    Outer loop MP 4: so not as many iterations would be needed (if the Numbers array is not initially sorted)

5b(ii) · 1 mark

  • 1 mark

    When Numbers (array) / array is already in (ascending) order / sorted

5c(i) · 2 marks

  • 1 mark

    The parameters / Num1 and Num2 are passed by value / BYVAL // The parameters / Num1 and Num2 are not passed / should be passed by reference / BYREF

  • 1 mark

    (The swap made inside) the procedure does not change the arguments used /parameters (passed) / the values stored in the Numbers elements passed // The procedure does not swap / change the values stored in the array

5c(ii) · 2 marks

  • 1 mark

    Procedure header: PROCEDURE Swap(BYREF Num1, Num2 : INTEGER)

  • 1 mark

    Procedure body correctly swapping variables using a temporary variable

6a · 8 marks

  • 1 mark

    Function heading, return type and ending

  • 1 mark

    Prompt for and input of plaintext

  • 1 mark

    Conditional loop that checks one of the boundary values

  • 1 mark

    Conditional loop that correctly checks both boundaries of plaintext

  • 1 mark

    …Re-input of plaintext in a loop

  • 1 mark

    Loop that iterates for number of spaces to add to end of plaintext // Use of string of at least 24 spaces

  • 1 mark

    …Spaces appended to plaintext // Spaces appended to an empty string // Correct use of LEFT() / MID() function and & to append padding characters

  • 1 mark

    Correctly padded plaintext returned following a reasonable attempt at MP7 / MP 6 and MP 7

6b(i) · 2 marks

  • 1 mark

    Boundaries of both array dimensions: [1 : 5, 1 : 5] or [0 : 4, 0 : 4]

  • 1 mark

    All other parts of declaration (Grid : ARRAY[...] OF CHAR)

6b(ii) · 8 marks

  • 1 mark

    Generate Index, 1 to 25, used to extract all characters from Plaintext

  • 1 mark

    Generate both Row and Col in a loop

  • 1 mark

    Extract an individual character from Plaintext in a loop

  • 1 mark

    Attempt to assign the extracted character to Grid in a loop

  • 1 mark

    Extraction and assignment of all 25 characters in Plaintext to Grid in a loop

  • 1 mark

    Attempt to identify / isolate 5 characters comprising at least one row

  • 1 mark

    Identify / isolate all 5 characters for all 5 rows

  • 1 mark

    Output all five rows of GRID, each on a separate line

Questions

  1. 1
    Question 127 marks
    Mark scheme ›
  2. 2
    Question 25 marks
    Mark scheme ›
  3. 3
    Question 36 marks
    Mark scheme ›
  4. 4
    Question 49 marks
    Mark scheme ›
  5. 5
    Question 510 marks
    Mark scheme ›
  6. 6
    Question 618 marks
    Mark scheme ›

More 9618 papers

Other papers from May/June 2026

Solve it on ExamPalStart