A Level Computer Science 9618 Paper 22, 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/22 · Oct/Nov 2025

Download PDF
1

Refer to the insert for the list of pseudocode functions and operators.

a

The table contains pseudocode examples. Each example may contain statements that relate to one or more of: • selection • iteration (repetition) • subroutines (procedures or functions). Complete the table by placing one or more ticks (‘✓’) in each row. Pseudocode example | Selection | Iteration | Subroutine IF Status = FALSE THEN FOR Count ← 1 TO 20 CALL Reset(Count) NEXT Count ENDIF OTHERWISE : Status ← TRUE WHILE AllDone() = TRUE 30 : NextChar ← 'X'

[4]
b

Complete the table by giving the appropriate data type. Variable | Example data value | Data type Result | 5.42 | MonthLetter | "JFMAMJJASOND" | Birthday | 15/11/2009 |

[3]
c

Evaluate each expression in the table by using the data values shown in (b). Write ‘ERROR’ if the expression contains an error. Expression | Evaluates to INT(Result) + 1 > 6 | NUM_TO_STR(LENGTH(MonthLetter)) | NUM_TO_STR(Result + "3.2") | MID(MonthLetter, MONTH(Birthday) - 2, 1) |

[4]
2

Data is a global 1D array containing 20 elements of type REAL An algorithm will: • input a sequence of real values, one at a time • assign each value to consecutive array elements, starting from index 1 • end when the value 99.9 is input, or all 20 elements have been assigned (the value 99.9 must not be stored in the array). Complete the program flowchart to represent the algorithm:

[5]
Figure 1 of 2 for question 2
Figure 2 of 2 for question 2
3

A text file OldFile.txt contains IDs, names and email addresses for members of a club. Three information items are stored for each member and each item is stored on a separate line. The example shows the information for the first two members in the first six lines of the file: Line in file | Information item | Example data 1 | member 1 ID | "AB1234" 2 | member 1 name | "Freddie Jones" 3 | member 1 email address | "FreddieJ909@Cambridge.org" 4 | member 2 ID | "BC2345" 5 | member 2 name | "Sue Smith" 6 | member 2 email address | "Sue1024@Cambridge.org" The member ID string is always two letters followed by four digits. The file design is to be changed so that information for each user is stored as a single line of the file, with the character '\' used as a separator between data items. For example, the single line for member 1 will be: "AB1234\Freddie Jones\FreddieJ909@Cambridge.org" An algorithm will produce a new file NewFile.txt from the contents of OldFile.txt Assume: • LineX, LineY and LineZ are of type STRING and are used to store the three items of information for each member • NewString is a temporary variable of type STRING • OldFile.txt exists and contains valid data.

a

The algorithm to create the new file is expressed in steps. Complete the following numbered steps: Step 1 : open the file ..................................... in ..................................... Step 2 : open the file ..................................... in ..................................... Step 3 : read a line from ..................................... and store in ..................................... Step 4 : read a line from ..................................... and store in ..................................... Step 5 : read a line from ..................................... and store in ..................................... Step 6 : set NewString to ........................................................................................... Step 7 : write NewString to ..................................... Step 8 : repeat from step ..................................... until ..................................... Step 9 : close both files.

[6]
b

The character '\' has been chosen as a separator. Explain why this is a suitable character.

[1]
c

Two new information items are to be stored for each member. Both new items are encrypted; they can each contain any character (including '\') and can be of any length up to a maximum of 99 characters. For example: Information item | Example data member 1 ID | "AB1234" member 1 name | "Freddie Jones" member 1 email address | "FreddieJ909@Cambridge.org" member 1 new information 1 | "En/98&*(|?\/D7iP" member 1 new information 2 | "23\CoboL" Explain the additional file design changes needed so that: • all the information items for each member are stored on a single line of NewFile.txt • it is possible to extract each information item after the line is read. Assume the '\' character is not used in any email address.

[3]
4

A quiz has nine questions. There are: • five easy questions each worth 3 points • four hard questions each worth 5 points. At the end of the quiz the points for each correctly answered question are added to give a total score. A check is made to test that the total score is valid using a 1D array CheckTotal of type BOOLEAN. Each index value of the array represents a possible total score. The corresponding element value is TRUE if the index value represents a valid total score and FALSE otherwise. The first nine rows of the array are: Index value | Element value | Comment 0 | TRUE | valid total score (no correct answers) 1 | FALSE | invalid total score 2 | FALSE | invalid total score 3 | TRUE | valid total score (one 3-point question correct) 4 | FALSE | invalid total score 5 | TRUE | valid total score (one 5-point question correct) 6 | TRUE | valid total score (two 3-point questions correct) 7 | FALSE | invalid total score 8 | TRUE | valid total score (one 3-point question and one 5-point question correct) For example, a total score of 6 points is valid; the value of the array element at index value 6 is TRUE

a

Write pseudocode to declare CheckTotal and to set all elements of the array to FALSE All variables used must be declared.

[4]
b

The pseudocode represents an algorithm to set the appropriate elements of the array to TRUE Complete the pseudocode: DECLARE EasyQ, HardQ : INTEGER FOR EasyQ ← ............................ TO 15 STEP ............................ FOR HardQ ← 0 TO ............................ STEP ............................ CheckTotal[.......................................................] ← TRUE NEXT HardQ NEXT EasyQ

[5]
c

The array elements have been assigned the required values. A module ValidateScore() will take an integer value representing a total score as a parameter. It will return TRUE if the total score is valid, or FALSE if it is not valid. Describe the algorithm for ValidateScore() using four steps. Do not use pseudocode in your answer. Step 1 ....................................................................................................................................... ................................................................................................................................................... Step 2 ....................................................................................................................................... ................................................................................................................................................... Step 3 ....................................................................................................................................... ................................................................................................................................................... Step 4 ....................................................................................................................................... ...................................................................................................................................................

[4]
5

A program is developed to satisfy a specific customer requirement. The project follows a program development life cycle model. This model divides the development process into several different stages.

a

The table lists some of the development activities. Complete the table by writing the name of the life cycle stage for each activity: Activity | Name of life cycle stage a structure chart is produced | a program is modified to allow it to run on new hardware | the programmer identifies the customer’s requirements | an Integrated Development Environment (IDE) provides context-sensitive help such as ‘auto-complete’ |

[4]
b

Alpha and beta testing has been completed. The final testing stage is carried out by the customer. Identify this final testing stage.

[1]
6

A string function Compare() will compare two strings. The function will: • take four parameters: ○ two strings, String1 and String2 ○ a character, Position, to indicate whether String1 will be compared with the start ('s'), or the end ('e') of String2 ○ a Boolean, CaseMatters, to indicate whether an upper case character and lower case character (for example, 'A' and 'a') are regarded as different (TRUE), or as the same (FALSE) • return FALSE if String2 has fewer characters than String1 • return TRUE if the comparison is true, otherwise return FALSE For example: Parameter | Return value String1 | String2 | CaseMatters | Position | "Cat" | "Catalogue" | TRUE | 's' | TRUE "CAT" | "Catalogue" | TRUE | 's' | FALSE "CAT" | "Catalogue" | FALSE | 's' | TRUE "Cat" | "Catalogue" | TRUE | 'e' | FALSE "GUE" | "Catalogue" | FALSE | 'e' | TRUE "Catalogue" | "Cat" | TRUE | 's' | FALSE Write pseudocode for the function Compare()

[7]
7

The structure chart shows part of a program design:

Figure 1 of 1 for question 7
a

Explain the meaning of the curved arrow symbol in this structure chart.

[2]
b

The program designer has noted that: • Count is the number of elements in an array • T1 is a value representing the number of elements in an array that have been modified • Key is of type STRING Write the pseudocode module headers for analyse, update and sort. Analyse: Update: Sort:

[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 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 7000 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 CountLoans() | • called with a parameter of type STRING representing a StudentID • counts the number of books currently on loan to the specified student • counts the number of books that the student has already returned • output both counts together with a suitable message

a

Write pseudocode for module CountLoans()

[7]
b

As a reminder, a global array Loan stores 7000 loan records with data items for each loan record: Data item | Data type | Comment StudentID | STRING | the unique ID of the student who has borrowed the book BookID | STRING | the unique ID of the book being borrowed OnLoan | BOOLEAN | TRUE if the book has not been returned A new module is defined: Module | Description NewLoan() | • called with two parameters of type STRING representing a StudentID and a BookID • searches the array for an unused loan record • if found, updates the loan record and returns TRUE, otherwise returns FALSE Write efficient pseudocode for NewLoan()

[7]
c

When a book is returned, the loan record will have its OnLoan data set to FALSE A new procedure Archive() will mark these records as unused after first saving them for future reference. Explain how these records can be saved for future reference.

[2]
d

It is decided to extend the program so that a new module Reminder() will send an email to the student three days before the book is due to be returned. Outline the changes that will need to be made to the data stored and how this data will be used to generate the reminder email. Data Use

[2]

Mark scheme

9618/22 · Oct/Nov 2025

Download PDF

1a · 4 marks

  • 1 mark

    Row 1: Selection (✓), Iteration (✓), Subroutine (✓)

  • 1 mark

    Row 2: Selection (✓)

  • 1 mark

    Row 3: Iteration (✓), Subroutine (✓)

  • 1 mark

    Row 4: Selection (✓)

1b · 3 marks

  • 1 mark

    REAL (for 5.42)

  • 1 mark

    STRING (for "JFMAMJJASOND")

  • 1 mark

    DATE (for 15/11/2009)

1c · 4 marks

  • 1 mark

    FALSE

  • 1 mark

    "12"

  • 1 mark

    ERROR

  • 1 mark

    "S"

2 · 5 marks

  • 1 mark

    Initialisation of the array index

  • 1 mark

    Input number in a loop

  • 1 mark

    Test for termination value (99.9) and correct ending

  • 1 mark

    Test for array full / maximum 20 iterations and correct ending

  • 1 mark

    Assign number to Data array element and increment index

3a · 6 marks

  • 1 mark

    open the file OldFile.txt in read (mode)

  • 1 mark

    open the file NewFile.txt in write (mode)

  • 1 mark

    read three lines from OldFile.txt and store in LineX, LineY and LineZ

  • 1 mark

    set NewString to LineX & '\' & LineY & '\' & LineZ

  • 1 mark

    write NewString to NewFile.txt

  • 1 mark

    repeat from step 3 until end of OldFile.txt (and close both files)

3b · 1 mark

  • 1 mark

    It does not appear in (any of) the data items // it does not appear in the ID and Name

3c · 3 marks

  • 1 mark

    Add a (single) new separator at the end of the third (original) item

  • 1 mark

    Calculate the length of both new data items

  • 1 mark

    Store / append the length (of the new each items)

  • 1 mark

    as a fixed length / separated digit string // by example

4a · 4 marks

  • 1 mark

    Declaration of CheckTotal array

  • 1 mark

    Declaration of a loop counter

  • 1 mark

    Loop – with correct syntax and number of iterations

  • 1 mark

    Assignment of array element to FALSE

4b · 5 marks

  • 1 mark

    0 (in FOR EasyQ ← 0)

  • 1 mark

    STEP 3 (in TO 15 STEP 3)

  • 1 mark

    0 (in FOR HardQ ← 0)

  • 1 mark

    STEP 5 (in TO 20 STEP 5)

  • 1 mark

    HardQ + EasyQ (in CheckTotal[HardQ + EasyQ])

4c · 4 marks

  • 1 mark

    Check that the parameter value is in the range 0 to 35

  • 1 mark

    ... and if not, return FALSE

  • 1 mark

    Use the parameter value as the index to array CheckTotal

  • 1 mark

    Return the value from given index position

5a · 4 marks

  • 1 mark

    Design

  • 1 mark

    Maintenance

  • 1 mark

    Analysis

  • 1 mark

    Coding

5b · 1 mark

  • 1 mark

    Acceptance testing

6 · 7 marks

  • 1 mark

    Function heading and parameters and ending and return type

  • 1 mark

    Calculate length of String1

  • 1 mark

    if String2 is shorter than String1, return FALSE

  • 1 mark

    Compare (modified) strings

  • 1 mark

    Test CaseMatters - if FALSE and convert two string(s) to same case

  • 1 mark

    Test for the value of ‘s’/’e’ and form modified string(s) in one or both cases

  • 1 mark

    Return appropriate BOOLEAN value in all cases

7a · 2 marks

  • 1 mark

    Reference to ‘repetition’…’

  • 1 mark

    Naming all four modules correctly and the sequence is stated or implied

7b · 4 marks

  • 1 mark

    PROCEDURE Analyse (Count : INTEGER)

  • 1 mark

    FUNCTION Update (Key : STRING)

  • 1 mark

    RETURNS INTEGER

  • 1 mark

    PROCEDURE Sort (BYREF P2 : BOOLEAN)

8a · 7 marks

  • 1 mark

    Declaration of Index and two count variables

  • 1 mark

    Loop for 7000 iterations

  • 1 mark

    Index references an indexed data item with correct .dot notation

  • 1 mark

    Attempt to compare the StudentID field = parameter in a loop

  • 1 mark

    Test of the OnLoan field and correct logic for both outcomes

  • 1 mark

    Both count variables initialised and increment appropriate count in a loop

  • 1 mark

    Output includes both counts with a suitable message

8b · 7 marks

  • 1 mark

    Loop through 7000 elements in Loan array – correct loop structure

  • 1 mark

    or until the first unused element is found // Correct RETURN inside a FOR loop

  • 1 mark

    Correct use of the indexed dot notation

  • 1 mark

    Test if record is unused (.StudentID = "") in a loop

  • 1 mark

    Two item assignment statements correct

  • 1 mark

    Loan[Index].OnLoan assigned TRUE

  • 1 mark

    Correct logic to return BOOLEAN in both cases (position found / no position available)

8c · 2 marks

  • 1 mark

    Save to/Open a (text) file

  • 1 mark

    Single line – form a string with separator characters and write to the file // Multiple lines - write each data item to a separate line in the file

8d · 2 marks

  • 1 mark

    Store the return date of each loan // the start date and the loan period

  • 1 mark

    Algorithm will do a calculation involving the MP1 data item(s)

  • 1 mark

    Store the student email address

  • 1 mark

    In order to send the email // the student is alerted to return the book

Questions

  1. 1
    Question 111 marks
    Mark scheme ›
  2. 2
    Question 25 marks
    Mark scheme ›
  3. 3
    Question 310 marks
    Mark scheme ›
  4. 4
    Question 413 marks
    Mark scheme ›
  5. 5
    Question 55 marks
    Mark scheme ›
  6. 6
    Question 67 marks
    Mark scheme ›
  7. 7
    Question 76 marks
    Mark scheme ›
  8. 8
    Question 818 marks
    Mark scheme ›

More 9618 papers

Other papers from Oct/Nov 2025

Solve it on ExamPalStart