A Level Computer Science 9618 Paper 23, Oct/Nov 2025

Question paper and mark scheme75 marks8 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/23 · Oct/Nov 2025

Download PDF
1

A user requires a program that implements complex data encryption to a recognised international standard. A programmer has started the design of the program.

a

The programmer decides to use a library routine to provide part of the solution. One reason for this is that library routines may perform functions that the programmer is unable to program themselves. State three other benefits of using library routines in the development of the program.

[3]
b(i)

The programmer has identified a different part of the algorithm that would be appropriate to implement as a subroutine (a procedure or a function); no suitable library routine exists for this part. State two reasons why the programmer may decide to use a subroutine.

[2]
b(ii)

A function header in pseudocode is defined as: FUNCTION Pass2(Count : INTEGER) RETURNS BOOLEAN Complete the table by describing the terms used in the function header. The first row has been completed. Term | Description Pass2 | the name of the function Count | BOOLEAN |

[2]
c

Variables in the program have example values: Variable | Example value DoB | 23/6/2011 Multiplier | 2.5 AddressLine[1] | "35 Lincoln Avenue" Complete the table by evaluating each expression using the example values: Expression | Evaluates to LENGTH(NUM_TO_STR(Multiplier)) | MONTH(DoB) > 4 | 15 + STR_TO_NUM(MID(AddressLine[1], 2, 1)) |

[3]
2
a

A program contains a global 1D array of type STRING containing 65 elements. An existing text file is used to store the data in the array. Only non-blank elements (those that do not contain an empty string) are written to the text file. An algorithm will: • write the first element of the array as a new line in the text file • continue until all elements have been written, each to a new line of the text file. Stepwise refinement is applied to the algorithm. Describe up to six steps for this algorithm that could be used to produce pseudocode. Do not use pseudocode statements in your answer.

[6]
b

Iteration is one programming construct. Identify one other programming construct that will be required when the algorithm from part (a) is converted into pseudocode and explain how it is used.

[2]
3

A program uses a stack to hold up to 30 integer values. The stack is implemented using a global integer variable and a global 1D array. The array is declared in pseudocode: DECLARE ThisStack : ARRAY[1:30] OF INTEGER Stack design notes: • The global variable SP acts as a stack pointer. SP contains the array index of the last value pushed onto the stack. • If the stack is empty, then SP is assigned the value zero. • The first item added to the stack will be stored in ThisStack[1] • SP is incremented each time an item is added to the stack. A function Pop() is written to remove an item from ThisStack. The function returns an item of type PopData which is defined in pseudocode: TYPE PopData DECLARE Data : INTEGER DECLARE Exists : BOOLEAN ENDTYPE The value removed from the stack is assigned to Data and Exists is set to TRUE. If it is not possible to remove a value from the stack, then Exists is set to FALSE Complete the pseudocode for Pop() FUNCTION Pop() RETURNS PopData DECLARE ThisPop : ............................................... IF ............................................... THEN PopData.Exists ← ............................................... // Stack is empty ELSE PopData.Data ← ............................................... PopData.Exists ← ............................................... SP ← ............................................... ENDIF RETURN ThisPop ENDFUNCTION

[5]
4

A program contains a global 1D array Data containing 20 elements of type INTEGER A global string NumString represents a sequence of three-digit numbers, separated by commas. For example: "101,456,219,754,328" The string contains at least four three-digit numbers. The total number of three-digit numbers in the string is unknown. A procedure Store() will: • extract one three-digit number at a time from NumString • convert each of the three-digit numbers extracted to an integer and assign this to the next array element, starting from index 1 • end when all three-digit numbers have been stored, or when the array is full. Complete the pseudocode for Store() All local variables used must be declared. PROCEDURE Store() ENDPROCEDURE

[6]
5

A global 1D array Num of integers contains four elements. A program assigns values to these elements as shown: Num[1] ← 1 Num[2] ← 2 Num[3] ← 5 Num[4] ← 3 A procedure Process() manipulates the values in the array. The procedure is written in pseudocode: PROCEDURE Process(Start : INTEGER) DECLARE CaseVar, Index, Count : INTEGER Index ← Start Count ← 0 WHILE Count <= 20 CaseVar ← Num[Index] CASE OF CaseVar 1 : Num[Index] ← Num[Index] + Index //clause one Index ← Index + 1 Count ← Count + 1 2 : Num[Index] ← Num[Index] + Index //clause two Index ← Index + 2 Count ← Count + 2 3 : Num[Index] ← Num[Index] * 2 //clause three Index ← Index + 3 Count ← Count - 1 4 : Count ← Count + 4 //clause four OTHERWISE : Count ← 20 ENDCASE Index ← (Index MOD 4) + 1 ENDWHILE ENDPROCEDURE

a

Complete the trace table by dry running the procedure when it is called in the statement: CALL Process(1)

[5]
b(i)

As a reminder, the CASE structure in the pseudocode is: CASE OF CaseVar 1 : Num[Index] ← Num[Index] + Index //clause one Index ← Index + 1 Count ← Count + 1 2 : Num[Index] ← Num[Index] + Index //clause two Index ← Index + 2 Count ← Count + 2 3 : Num[Index] ← Num[Index] * 2 //clause three Index ← Index + 3 Count ← Count - 1 4 : Count ← Count + 4 //clause four OTHERWISE : Count ← 20 ENDCASE The CASE structure could be optimised by combining two existing clauses. Identify the CaseVar values for these two existing clauses.

[1]
b(ii)

Write pseudocode for a single clause to replace the two clauses identified in (b) (i).

[2]
6

Students are learning about a simple check digit method for data validation. In this method, a single check digit is appended to the end of an original number to give a new number. The students are studying a method which: • calculates the sum of all the digits in the original number • uses integer division to calculate the remainder when the sum is divided by 10 • uses the remainder as the check digit • appends the check digit to the original number, creating the new number. For example: original number | 4162 sum of all digits | 4 + 1 + 6 + 2 = 13 remainder when the sum is divided by 10 using integer division | 3 new number | 41623 The original number is always at least three digits in length. When the new number is input, the check digit is used to validate the new number.

a

A function Generate() is written to take an original number as a parameter and to return the check digit. Outline a test plan that could be used to fully test function Generate() Assume that the parameter is valid.

[2]
b

A function CheckNumber() will take an integer value and return the Boolean value TRUE if the check digit is correct, otherwise return FALSE Write pseudocode for the function CheckNumber() Assume that the parameter is valid.

[7]
7

There are several different ways to express an algorithm during the design of a program.

a

One part of the program contains an algorithm which is represented by a state-transition diagram. The table shows the inputs, outputs and states for the algorithm: Current state | Input | Output | Next state S1 | A1 | | S2 S2 | A2 | X4 | S3 S3 | A1 | X1 | S3 S3 | A2 | X1 | S3 S3 | A3 | X3 | S4 S3 | A4 | | S2 S4 | A3 | X4 | S5 S4 | A4 | X4 | S5 S4 | A1 | | S2 Complete the state-transition diagram to represent the information given in the table:

[5]
b

A structure chart is used to document a different part of the program, made up of five modules. Program notes: • module Setup calls either module Restart, or module Confirm • module Confirm takes a string as a parameter and returns an integer • module Modify has no parameters and returns a Boolean • module Update takes a string as a parameter • module Restart repeatedly calls module Update followed by module Modify • module Restart takes a string as a parameter that is passed by reference. Draw a structure chart to represent the relationship between the five modules, including all parameters and return values.

[4]
8

A program is being developed to manage student book loans from a college library. The programmer has defined a record type to define each loan. The data items are: Data item | Data type | Comment StudentID | STRING | the unique ID of the student who has borrowed the book The first three characters of a StudentID represent a tutor ID. Each student has one tutor. BookID | STRING | the unique ID of the book being borrowed OnLoan | BOOLEAN | TRUE if the book has not been returned The programmer has defined a global array Loan to store 8000 loan records. There are more elements in the array than books in the library. Unused elements have the StudentID set to an empty string. These may occur anywhere in the array. The programmer has defined a program module: Module | Description LoanStatus() | • called with two parameters of type STRING representing a StudentID and a BookID • outputs a message saying whether a given loan has been returned or not • outputs a warning message if a record of the given loan is not found

a

Write efficient pseudocode for the module LoanStatus() Assume that each combination of StudentID and BookID can occur only once.

[8]
b

A second module is defined: Module | Description LoansPerTutor() | • called with a parameter of type STRING representing a tutor ID (as a reminder, the first three characters of a StudentID represent a tutor ID) • returns an integer value representing the number of books currently on loan to students who have the given tutor Reminder: unused elements have the StudentID set to an empty string. These may occur anywhere in the array. Write pseudocode for the module LoansPerTutor()

[7]
c(i)

It is decided to mark as unused all records for book loans that have been returned. The data for these records will first be written to a new text file for archive purposes. The archive program will automatically generate a meaningful filename each time it is run. Outline a meaningful format to use for the filename.

[2]
c(ii)

There is a problem that will need to be overcome before the data items can be written to a text file. As a reminder, the data items are: Data item | Data type | Comment StudentID | STRING | the unique ID of the student who has borrowed the book The first three characters of a StudentID represent a tutor ID. Each student has one tutor. BookID | STRING | the unique ID of the book being borrowed OnLoan | BOOLEAN | TRUE if the book has not been returned Explain the problem.

[1]
c(iii)

One way of storing the data items in a text file is to store each data item on a separate line. Identify one benefit and one drawback of this way of storing the data.

[2]

Mark scheme

9618/23 · Oct/Nov 2025

Download PDF

1a · 3 marks

  • 1 mark

    They are tried and tested // Free from errors

  • 1 mark

    They are readily available // Speed up development time

  • 1 mark

    They will be updated automatically when improvements are made // No maintenance of routine is needed (as automatically updated)

  • 1 mark

    The algorithm will be compliant with the international standard

1b(i) · 2 marks

  • 1 mark

    When a part of the algorithm performs a specific task

  • 1 mark

    Part is repeated // performed in several places

  • 1 mark

    Testing / debugging / maintenance is easier

1b(ii) · 2 marks

  • 1 mark

    Count: The parameter / value passed to the function

  • 1 mark

    BOOLEAN: The (data) type returned (by the function)

1c · 3 marks

  • 1 mark

    LENGTH(NUM_TO_STR(Multiplier)) evaluates to 3

  • 1 mark

    MONTH(DoB) > 4 evaluates to TRUE

  • 1 mark

    15 + STR_TO_NUM(MID(AddressLine[1], 2, 1)) evaluates to 20

2a · 6 marks

  • 1 mark

    Open the file in append mode (and subsequently close) before loop

  • 1 mark

    Initialise a variable to 1 / 0 before loop

  • 1 mark

    Use the variable as an index to the array to access an element in a loop

  • 1 mark

    Test if element value is blank / empty in a loop

  • 1 mark

    If not blank then write the value to the file in a loop

  • 1 mark

    Increment the variable in a loop

  • 1 mark

    Repeat from MP3 until variable value is 66 / 65 / all elements (in the array) have been checked

2b · 2 marks

  • 1 mark

    Construct: Selection // Sequence

  • 1 mark

    Use: To test whether the (array) element is blank // To specify the order in which the steps of the algorithm have to be followed so that the task is completed correctly

3 · 5 marks

  • 1 mark

    One mark for both assignments to PopData.Exists (FALSE and TRUE)

  • 1 mark

    DECLARE ThisPop : PopData

  • 1 mark

    IF SP < 1 // SP = 0 THEN

  • 1 mark

    PopData.Data ← ThisStack[SP]

  • 1 mark

    SP ← SP - 1

4 · 6 marks

  • 1 mark

    Declare all local variables used

  • 1 mark

    Conditional loop while end of string not reached

  • 1 mark

    ... and array not full

  • 1 mark

    Attempted use of MID() // Attempted use of Right() and Left()

  • 1 mark

    Correct extraction and use next three letter substring from NumString in a loop

  • 1 mark

    Convert to integer and assign value to array element in a loop

  • 1 mark

    Correct increment of array index by 1 and start position of substring by 4

5a · 5 marks

  • 1 mark

    Zone 1: correct values as shown

  • 1 mark

    Zone 2: correct values as shown

  • 1 mark

    Zone 3: correct values as shown

  • 1 mark

    Zone 4: correct values as shown

  • 1 mark

    Zone 5: Num[4] set to 6 when Index is 7 and Num[1] set to 3 when index is 3 for second time

5b(i) · 1 mark

  • 1 mark

    1 and 2

5b(ii) · 2 marks

  • 1 mark

    use of variable CaseVar rather than literal values

  • 1 mark

    completely correct clause

6a · 2 marks

  • 1 mark

    Create a list of numbers that should generate all of the possible check digit values

  • 1 mark

    and check that each / the / a generated value is as expected

6b · 7 marks

  • 1 mark

    Function Header including Identifier, parameters and return type

  • 1 mark

    Use of Num_TO_STR to convert parameter // Use of Num_TO_STR to convert parameter excluding least significant digit to a string // Initialise Sum

  • 1 mark

    Extract CheckDigit from NumString // Extract least significant digit from parameter // Set CheckDigit to least significant digit in Number

  • 1 mark

    Loop for length of NumString - 1 following correct convesrion to string // Loop while Number > 0

  • 1 mark

    attempt to form sum of digits in a loop // attempt to use MOD and DIV to sum successive digits in Number in loop

  • 1 mark

    completely correct sum of digits in a loop and of sum initialised before loop // completely correct sum of all digits in Number apart from least significant digit in loop

  • 1 mark

    Calculate check digit from sum

  • 1 mark

    Compare sum with final digit of parameter and return appropriate Boolean value // Compare with CheckDigit and return appropriate Boolean value

7a · 5 marks

  • 1 mark

    S2 to S5 labelled

  • 1 mark

    Label A1 added to event from S1 to S2

  • 1 mark

    Event lines from S2 to S3 and S3 to S2 correctly labelled

  • 1 mark

    Events lines from S3 to S3 and event line from S3 to S4 all labelled correctly

  • 1 mark

    Event lines from S4 to S5 correctly and event line from S4 to S2 labelled correctly

7b · 4 marks

  • 1 mark

    All boxes correctly labelled and connected in correct hierarchy

  • 1 mark

    BYREF parameter to Restart, parameter to Confirm and return

  • 1 mark

    Diamond and loop symbol

  • 1 mark

    Parameter to Update and return from Modify

8a · 8 marks

  • 1 mark

    Procedure heading, parameters and ending

  • 1 mark

    Loop through all elements in Loan array

  • 1 mark

    ... or until record loan is found

  • 1 mark

    Test for correct StudentID in a loop

  • 1 mark

    ... and correct BookID

  • 1 mark

    ... check OnLoan data item

  • 1 mark

    ... and output both messages as appropriate regarding book loan status once

  • 1 mark

    If no matching loan found, Output 'not found' after the loop

8b · 7 marks

  • 1 mark

    Initialise local integer for Count

  • 1 mark

    Loop through all elements in the Loan array

  • 1 mark

    Attempt at referencing a data item in a loop

  • 1 mark

    Extract TutorID from Loan[Index].StudentID in a loop

  • 1 mark

    Test for Matching Tutor AND test if the book has been returned using correct dot notation in a loop

  • 1 mark

    ... if true then increment Count in a loop

  • 1 mark

    Return count

8c(i) · 2 marks

  • 1 mark

    Include (a suffix string based on) the date of the archive / the next number in sequence

  • 1 mark

    Concatenate with a root filename such as 'Archive'

8c(ii) · 1 mark

  • 1 mark

    Boolean data cannot be written to a text file // OnLoan is not a string // OnLoan will have to be converted to text

8c(iii) · 2 marks

  • 1 mark

    Benefit: Algorithm to store / extract a record is easier // unpacking of data is not required // No need for string concatenation

  • 1 mark

    Drawback: More file accesses needed (to read / write a complete record)

Questions

  1. 1
    Question 110 marks
    Mark scheme ›
  2. 2
    Question 28 marks
    Mark scheme ›
  3. 3
    Question 35 marks
    Mark scheme ›
  4. 4
    Question 46 marks
    Mark scheme ›
  5. 5
    Question 58 marks
    Mark scheme ›
  6. 6
    Question 69 marks
    Mark scheme ›
  7. 7
    Question 79 marks
    Mark scheme ›
  8. 8
    Question 820 marks
    Mark scheme ›

More 9618 papers

Other papers from Oct/Nov 2025

Solve it on ExamPalStart