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

Download PDF
1

Refer to the insert for the list of pseudocode functions and operators. 1 A program is being developed to meet a particular customer requirement.

a

The program contains these variables: Variable | Data type MyChar | CHAR MyString | STRING MyInt | INTEGER MyDOB | DATE Complete the table by filling in the gaps using functions and/or operators from the insert. Each expression must be valid. Expression MyString ← 'X' .............................. MyString MyChar ← .............................. ("ABCD", ............... , ...............) MyString ← .............................. (.............................. (MyDOB)) MyInt ← .............................. (.............................. (MyString) / 2)

[4]
b

Different test methods will be used at different stages of the program development. Complete the table by identifying the test method that matches the test description. The first row has been completed for you. Test description | Test method carried out as soon as a program module has been coded | alpha carried out as program modules are being combined | completed by the developers without referring to the code | completed by the customer |

[3]
c

During the alpha testing stage, an Integrated Development Environment (IDE) is used to help locate an error that has been identified. The IDE report window feature is used to examine the values assigned to variables. Explain how two other IDE features are used together with the report window feature to help locate the error.

[3]
2

Data is a global 1D array containing 30 elements of type STRING An algorithm will output: • all non-blank elements (elements that do not contain an empty string) • the final total of the number of elements output. Complete the program flowchart to represent the algorithm: START END

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

A program is needed to manage individual rentals in a car-hire business. The data items for each rental will be held in a record structure of type RentalRecord The programmer has started to define the items that will be needed: Item | Example value | Comment RentalID | "AB1234" | a unique alpha-numeric value CarID | 241 | a numeric value used as an array index DisCode | 'S' | a letter indicating the type of discount offered Start | 13/06/2025 | when the rental starts Duration | 7 | the number of days of the rental Completed | FALSE | TRUE when the car is returned and the rental charge paid

a(i)

Write pseudocode to declare the record structure for type RentalRecord

[4]
a(ii)

A 1D array Rental containing 500 elements is used to store the data for all rental records. Write pseudocode to declare the Rental array.

[2]
b

State three benefits of using an array of records to store the data for all rentals. 1 ................................................................................................................................................ ................................................................................................................................................... 2 ................................................................................................................................................ ................................................................................................................................................... 3 ................................................................................................................................................ ...................................................................................................................................................

[3]
4

A program contains a global 1D array Number consisting of 20 elements of type REAL A procedure Store() will input a sequence of up to 20 real values, one value at a time. These values will be assigned to elements of the array using four steps: Step 1: store the first value in the sequence in the first element of the array Step 2: check each subsequent value input. If this value is larger than the previous value input, then assign the value to the next array element, otherwise go to step 4 Step 3: repeat from step 2 unless the array is full Step 4: output the count of the number of values stored in the array together with a suitable message.

a

Complete the pseudocode for Store() All variables used in the algorithm must be declared. PROCEDURE Store() ENDPROCEDURE

[6]
b(i)

The requirements of the program change: • the number of values in the sequence is unknown, but may be higher than 20 • the values will need to be accessed by another program as data. The data will be stored in a text file instead of an array. Give two benefits of using a text file instead of an array. 1 ........................................................................................................................................ ........................................................................................................................................... 2 ........................................................................................................................................ ...........................................................................................................................................

[2]
b(ii)

State any change that will need to be made before each value is written to the file.

[1]
5

A program is being designed in pseudocode. The program contains the following declaration for the global array MyData: DECLARE MyData : ARRAY[1:10000] OF STRING A function FindFirst() is written to search the array for a given string and to return the index of the first element where that string is found, or to return –1 if the string is not found. The function is written in pseudocode as shown: FUNCTION FindFirst(SearchString : STRING) RETURNS INTEGER DECLARE Index, FoundAt : INTEGER FoundAt ← –1 FOR Index ← 1 TO 10000 IF MyData[Index] = SearchString THEN // outer conditional clause IF FoundAt = –1 THEN // inner conditional clause FoundAt ← Index ENDIF ENDIF NEXT Index RETURN FoundAt ENDFUNCTION

a(i)

Comment on why the programmer chose –1 as the initial value of FoundAt

[1]
a(ii)

Explain the purpose of the outer conditional clause.

[1]
a(iii)

The inner conditional clause ensures that only the index of the first matching element, if any, is returned. Explain how this clause works.

[1]
b(i)

The pseudocode does not use the most appropriate loop construct. Explain why this is not the most appropriate loop construct.

[1]
b(ii)

Suggest and justify a more appropriate loop construct that could be used. Construct ........................................................................................................................... Justification ....................................................................................................................... ...........................................................................................................................................

[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 method described can be used to detect single-digit errors. For example, if the new number is incorrectly input as 41633, then the check digit does not match and the input will be rejected.

a

An incorrect attempt was made to enter 41623. The first two digits were entered incorrectly; the last three digits were entered correctly. When this number was tested, the check digit was found to be correct and the input was accepted. Identify an example of the incorrect attempt to enter 41623 and explain why this number would not be rejected. Number ..................................................................................................................................... Explanation ............................................................................................................................... ...................................................................................................................................................

[2]
b

A module Generate() will take an integer value representing an original number and return an integer value representing a new number which includes the check digit. The original number is always at least three digits in length. Write pseudocode for the module Generate() Assume that the parameter is valid.

[7]
7

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

Figure 1 of 3 for question 7
Figure 2 of 3 for question 7
Figure 3 of 3 for question 7
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 | A2 | X2 | S3 S1 | A1 | X1 | S2 S2 | A4 | X4 | S5 S3 | A1 | | S3 S3 | A3 | X3 | S2 S3 | A2 | X4 | S4 S4 | A1 | X1 | S4 S4 | A3 | | S2 S4 | A4 | X4 | S5 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. This part of the program contains six modules: Pseudocode module header PROCEDURE Setup() PROCEDURE Restart(H1 : STRING, C1 : INTEGER) FUNCTION Modify(B1 : BOOLEAN) RETURNS INTEGER PROCEDURE Final(T1 : INTEGER) PROCEDURE Update(BYREF R2 : STRING) FUNCTION Confirm() RETURNS BOOLEAN Module Setup will repeatedly call three of the modules. Complete the structure chart to document the information given in the table.

[5]
8

A program is being developed to manage student book loans from a college library. Students may borrow up to five books at a time from the library. The programmer has defined a record type to define each loan. The record 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 5000 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 the first program module: Module | Description OKToBorrow() | • called with a parameter of type STRING representing a StudentID • search the array for loan records for the specified student • output a suitable message to say whether the student may, or may not, borrow another book

a

Write efficient pseudocode for the module OKToBorrow()

[7]
b

A second module is defined: Module | Description ReturnBook() | • called with two parameters of type STRING representing a StudentID and a BookID • searches the array for the relevant loan record • when found, sets OnLoan to FALSE and returns TRUE • if a loan record is not found, or the book has already been returned, then returns FALSE Write efficient pseudocode for the module ReturnBook() Assume that each student is only allowed to borrow each book only once. That means that there will be no more than one loan record for a given combination of student and book.

[8]
c

It is decided to introduce a system of fines for books that have been borrowed for too long. Two new requirements are defined: 1. Each loan has a maximum length, represented as a number of days. 2. Each book in the library will be assigned one of three categories. Each category has a different maximum loan length. Record structure and program design changes are needed to meet these two requirements. Outline the changes that are necessary to meet the two requirements.

[2]

Mark scheme

9618/21 · Oct/Nov 2025

Download PDF

1a · 4 marks

  • 1 mark

    MyString  'X' & MyString

  • 1 mark

    MyChar  MID ("ABCD", 1 / 2 / 3 / 4 , 1)

  • 1 mark

    MyString  NUM_TO_STR (DAY / MONTH / YEAR / DAYINDEX (MyDOB))

  • 1 mark

    MyInt  INT(LENGTH(MyString) / 2)

1b · 3 marks

  • 1 mark

    carried out as program modules are being combined: integration

  • 1 mark

    completed by the developers without referring to the code: black-box

  • 1 mark

    completed by the customer: acceptance / beta

1c · 3 marks

  • 1 mark

    reference to a breakpoint

  • 1 mark

    reference to single stepping

  • 1 mark

    Correct explanation of both e.g. to stop program execution at specific point / line / statement / instruction and to execute one line / statement / instruction at a time to (locate an/the error)

2 · 5 marks

  • 1 mark

    Initialisation of variables used as array index and count

  • 1 mark

    Loop through exactly 30 elements in the array

  • 1 mark

    Test for empty string in current array element // Test for non-empty string

  • 1 mark

    Increment count if appropriate in a loop

  • 1 mark

    Both required outputs under correct conditions with correct outputs

3a(i) · 4 marks

  • 1 mark

    One mark for TYPE RentalRecord and ENDTYPE statements

  • 1 mark

    One mark for RentalID and CarID declared correctly

  • 1 mark

    One mark for DisCode and Start declared correctly

  • 1 mark

    One mark for Duration and Completed declared correctly

3a(ii) · 2 marks

  • 1 mark

    ARRAY[1:500]

  • 1 mark

    OF RentalRecord

3b · 3 marks

  • 1 mark

    Different data types held (for each rental) under a single identifier

  • 1 mark

    Allows for iteration through rentals/records // Can access rentals/records in a loop // Can (directly) access a specific rental/record using an (array) index

  • 1 mark

    Simplifies the code/program / less code needed / reduces code duplication // Makes code/program easier to understand // Makes testing / debugging easier // Program maintenance easier

4a · 6 marks

  • 1 mark

    Declare local variables Index as integer, ThisNum and LastNum as real

  • 1 mark

    Input value and assign to first element

  • 1 mark

    Attempt at conditional loop including both tests // Count-controlled loop

  • 1 mark

    Completely correct conditional loop including both tests // Count-controlled loop with BREAK if current value greater than previous value

  • 1 mark

    Assign input value to current element if greater than previous element and input next value in a loop // ... Assign input value to current element following correct comparison in a loop

  • 1 mark

    Final output giving attempted count of elements stored plus message after a loop // Final output giving count of elements stored plus message following a reasonable attempt after loop

4b(i) · 2 marks

  • 1 mark

    The amount of values stored (in a text file) is not fixed / not limited (other than by secondary storage available) // The amount values stored is not limited to the size of the array

  • 1 mark

    The data is stored permanently / non-volatile // Data can be restored / reused without re-entering values

4b(ii) · 1 mark

  • 1 mark

    Each (real) value would have to be converted to a string

5a(i) · 1 mark

  • 1 mark

    It is a value that is invalid as an (array) index // not in the range of valid (index) values

5a(ii) · 1 mark

  • 1 mark

    To test whether the current element / value at index matches the given / search string / data / parameter

5a(iii) · 1 mark

  • 1 mark

    The value of FoundAt is only updated to the (current) index if it currently stores the initial value / -1 // FoundAt is not updated when it currently stores any other value than -1

5b(i) · 1 mark

  • 1 mark

    The loop continues after the (first instance) of the search value / string / matching element has been found // Comparisons/tests continue to be made even if the search value / string / matching element has been found

5b(ii) · 2 marks

  • 1 mark

    Construct: A conditional loop

  • 1 mark

    Justification: The loop / search can be terminated as soon as the (first occurrence of) SearchString / required value / required string / matching element is found

6a · 2 marks

  • 1 mark

    Number: Any number where the first two digits sum to 5 / 15 and the last three digits are 623

  • 1 mark

    Explanation: The remainder is the same / 3 // The sum of the (first four) digits is the same / 13

6b · 7 marks

  • 1 mark

    Function heading, parameters return type and ending

  • 1 mark

    Initialise Total

  • 1 mark

    Convert Number to a string and loop for length of converted Number // Loop while Num > 0

  • 1 mark

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

  • 1 mark

    completely correct sum of digits in a loop // completely correct sum of digits

  • 1 mark

    Calculate CheckDigit

  • 1 mark

    Add CheckDigit to original number multiplied by 10 and return number // Convert CheckDigit to a character and appended to NumString and then convert to a number and return // Add CheckDigit to original number and return number

7a · 5 marks

  • 1 mark

    Label A1 | X1 added on line from S1 to state labelled S2

  • 1 mark

    States S3, S4 and S5 labelled

  • 1 mark

    Line from S2 to S5 with event label A4|X4

  • 1 mark

    Lines from S3 with correct event labels including 'loop' label

  • 1 mark

    Lines from S4 with correct event labels including 'loop'

7b · 5 marks

  • 1 mark

    All boxes correctly labelled

  • 1 mark

    Iteration arrow

  • 1 mark

    Parameter to Restart

  • 1 mark

    Return value from Modify and parameter to Final

  • 1 mark

    BYREF parameter to Update

8a · 7 marks

  • 1 mark

    Procedure heading, parameter and ending

  • 1 mark

    Loop through all elements in Loan array

  • 1 mark

    ... terminating if Max reached

  • 1 mark

    Test for correct StudentID field in a loop

  • 1 mark

    ... and that OnLoan = TRUE in a loop

  • 1 mark

    ... if so, then increment Count in a loop

  • 1 mark

    Output an appropriate message in both cases after the loop

8b · 8 marks

  • 1 mark

    Loop through all elements in Loan array

  • 1 mark

    ...and book loan not found

  • 1 mark

    Attempt to reference an individual data item in a loop

  • 1 mark

    Correct test for StudentID and correct BookID in a loop

  • 1 mark

    … If book not returned yet, then set OnLoan field to FALSE

  • 1 mark

    RETURN TRUE if book loan Found and not already returned

  • 1 mark

    RETURN FALSE if book loan Found and loan already returned

  • 1 mark

    RETURN FALSE if book loan not found

8c · 2 marks

  • 1 mark

    Change to existing Record: Store date due back as a new data item / in the loan record // Store date of loan and the loan length category as new data items / in the loan record // New Record: New Records with Category (and Loan length field) (Max 1)

  • 1 mark

    Change to Program: (Use the loan length category of a book to) calculate the date due date // Compare due date with today’s date (to check if overdue / to calculate fine) // Map loan length category to length of loan / date due back (Max 1)

Questions

  1. 1
    Question 110 marks
    Mark scheme ›
  2. 2
    Question 25 marks
    Mark scheme ›
  3. 3
    Question 39 marks
    Mark scheme ›
  4. 4
    Question 49 marks
    Mark scheme ›
  5. 5
    Question 56 marks
    Mark scheme ›
  6. 6
    Question 69 marks
    Mark scheme ›
  7. 7
    Question 710 marks
    Mark scheme ›
  8. 8
    Question 817 marks
    Mark scheme ›

More 9618 papers

Other papers from Oct/Nov 2025

Solve it on ExamPalStart