9618/23 · October/November 2025 · Worked solutions

Step-by-step solutions based on the mark scheme (not a mark-scheme dump).

Question 1

Paper page 2 for Q1
Original paper page 2

Part 1(a) — solution

Answers include: 3

Mark points

  • Include the ideas shown in the solution above.

Part 1 — solution

They are tried and tested // Free from errors

Mark points

  • Include the ideas shown in the solution above.

Part 1(b)(i) — solution

1 When a part of the algorithm performs a specific task 2

Mark points

  • Include the ideas shown in the solution above.

Part 1(b)(ii) — solution

Answer: 2

  1. Pass2 the name of the function

Mark points

  • Pass2 the name of the function

Part 1(c) — solution

Answer: 3

3 Expression Evaluates to LENGTH(NUM_TO_STR(Multiplier)) 3 MONTH(DoB) > 4 TRUE

Mark points

  • Correct result: 3

Part 1 — solution

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

Mark points

  • Include the ideas shown in the solution above.

Part 1 — solution

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

Mark points

  • Include the ideas shown in the solution above.

Part 1 — solution

Function Header including Identifier, parameters and return type

Mark points

  • Include the ideas shown in the solution above.

Part 1 — solution

Function Header including Identifier, parameters and return type

Mark points

  • Include the ideas shown in the solution above.

Part 1 — solution

All boxes correctly labelled and connected in correct hierarchy

Mark points

  • Include the ideas shown in the solution above.

Part 1 — solution

Procedure heading, parameters and ending

Mark points

  • Include the ideas shown in the solution above.

Part 1 — solution

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

Mark points

  • Include the ideas shown in the solution above.

Question 2

Paper page 4 for Q2
Original paper page 4

Part 2 — solution

They are readily available // Speed up development time

Mark points

  • Include the ideas shown in the solution above.

Part 2 — solution

Part is repeated // performed in several places

Mark points

  • Include the ideas shown in the solution above.

Part 2(a) — solution

One mark per point: 6

Mark points

  • Include the ideas shown in the solution above.

Part 2 — solution

Initialise a variable to 1 / 0 before loop

Mark points

  • Include the ideas shown in the solution above.

Part 2(b) — solution

One mark per point: 2 Construct: Selection Use: To test whether the (array) element is blank Alternative: Construct: Sequence Use: To specify the order in which the steps of the algorithm have to be followed so that the task is completed correctly

Mark points

  • Include the ideas shown in the solution above.

Part 2 — solution

Conditional loop while end of string not reached

Mark points

  • Include the ideas shown in the solution above.

Part 2 — solution

Loop for 20 iterations // number of 3-digit numbers in the NumString

Mark points

  • Include the ideas shown in the solution above.

Part 2 — solution

Conditional loop while end of string not reached

Mark points

  • Include the ideas shown in the solution above.

Part 2 — solution

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

Mark points

  • Include the ideas shown in the solution above.

Part 2 — solution

BYREF parameter to Restart, parameter to Confirm and return

Mark points

  • Include the ideas shown in the solution above.

Part 2 — solution

Loop through all elements in the Loan array

Mark points

  • Include the ideas shown in the solution above.

Part 2 — solution

Concatenate with a root filename such as 'Archive'

Mark points

  • Include the ideas shown in the solution above.

Question 3

Paper page 6 for Q3
Original paper page 6

Part 3 — solution

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

Mark points

  • Include the ideas shown in the solution above.

Part 3 — solution

Testing / debugging / maintenance is easier One mark for each point Max 2

Mark points

  • Include the ideas shown in the solution above.

Part 3 — solution

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

Mark points

  • Include the ideas shown in the solution above.

Part 3 — solution

  1. IF SP < 1 // SP = 0 THEN MP 3

Mark points

  • IF SP < 1 // SP = 0 THEN MP 3

Part 3 — solution

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

Mark points

  • Include the ideas shown in the solution above.

Part 3 — solution

Extract CheckDigit from NumString // Extract least significant digit from parameter

Mark points

  • Include the ideas shown in the solution above.

Part 3 — solution

Set CheckDigit to least significant digit in Number

Mark points

  • Include the ideas shown in the solution above.

Part 3 — solution

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

Mark points

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

Part 3 — solution

Attempt at referencing a data item in a loop

Mark points

  • Include the ideas shown in the solution above.

Question 4

Paper page 8 for Q4
Original paper page 8

Part 4 — solution

The algorithm will be compliant with the international standard One mark per point Max 3

Mark points

  • Include the ideas shown in the solution above.

Part 4 — solution

Test if element value is blank / empty in a loop

Mark points

  • Include the ideas shown in the solution above.

Part 4 — solution

Example solution: 6 PROCEDURE Store() DECLARE Index, StartPos, ThisNum : INTEGER DECLARE ThisString : STRING Index  1 StartPos  1 WHILE StartPos < LENGTH(NumString) AND Index < 21 ThisString  MID(NumString, StartPos, 3) ThisNum  STR_TO_NUM(ThisString) Data[Index]  ThisNum Index  Index + 1 StartPos  StartPos + 4 ENDWHILE ENDPROCEDURE Mark as follows:

Mark points

  • Include the ideas shown in the solution above.

Part 4 — solution

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

Mark points

  • Include the ideas shown in the solution above.

Part 4 — solution

  1. IF Index = 20 THEN

Mark points

  • IF Index = 20 THEN

Part 4 — solution

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

Mark points

  • Include the ideas shown in the solution above.

Part 4 — solution

  1. WHILE Index <= 20 AND Position <= LENGTH(NumString)
  2. IF Character = ','

Mark points

  • WHILE Index <= 20 AND Position <= LENGTH(NumString)
  • IF Character = ','

Part 4 — solution

Correct extraction and use of a character from NumString in a loop

Mark points

  • Include the ideas shown in the solution above.

Part 4 — solution

Loop for length of NumString – 1 following correct convesrion to string

Mark points

  • Include the ideas shown in the solution above.

Part 4 — solution

  1. Events lines from S3 to S3 and event line from S3 to S4 all labelled

Mark points

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

Part 4 — solution

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

Mark points

  • Include the ideas shown in the solution above.

Question 5

Paper page 10 for Q5
Original paper page 10

Part 5 — solution

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

Mark points

  • Include the ideas shown in the solution above.

Part 5 — solution

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

Mark points

  • Include the ideas shown in the solution above.

Part 5 — solution

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

Mark points

  • Include the ideas shown in the solution above.

Part 5(a) — solution

Answer: 5

5 Zone 1 Zone 2 Zone 3 Zone 4 Zone 5 Zones 1 to 4 : One mark for each set of values as shown Zone 5: Num[4] set to 6 when Index is 7 and Num[1] set to 3 when index is 3 for second time

Mark points

  • Correct result: 5

Part 5(b)(i) — solution

1 and 2 1

Mark points

  • Include the ideas shown in the solution above.

Part 5(b)(ii) — solution

  1. use of variable CaseVar rather than literal values
  2. completely correct clause

Mark points

  • use of variable CaseVar rather than literal values
  • completely correct clause

Part 5 — solution

attempt to use MOD and DIV to sum successive digits in Number in loop

Mark points

  • Include the ideas shown in the solution above.

Part 5 — solution

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

Mark points

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

Part 5 — solution

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

Mark points

  • Include the ideas shown in the solution above.

Question 6

Paper page 14 for Q6
Original paper page 14

Part 6 — solution

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

Mark points

  • Include the ideas shown in the solution above.

Part 6 — solution

If true convert substring to number … and store in Data array and set SubString to "" and increment Index

Mark points

  • Include the ideas shown in the solution above.

Part 6(a) — solution

One mark per point: 2

Mark points

  • Include the ideas shown in the solution above.

Part 6(b) — solution

Note 2 different solutions with different mark scheme 7 Example solution – conversion to string and using a loop FUNCTION CheckNumber(Number : INTEGER) RETURNS BOOLEAN DECLARE Total, Index, CheckDigit : INTEGER DECLARE NumString : STRING Total  0 NumString  NUM_TO_STR(Number) CheckDigit  STR_TO_NUM(RIGHT(NumString, 1)) // CheckDigit  Number MOD 10 FOR Index  1 TO LENGTH(NumString) – 1 // 1 TO LENGTH(NUM_TO_STR(Number DIV 10)) Total  Total + STR_TO_NUM(MID(NumString, Index, 1)) ENDFOR IF Total MOD 10 <> CheckDigit THEN RETURN FALSE ENDIF RETURN TRUE ENDFUNCTION Mark as follows:

Mark points

  • Include the ideas shown in the solution above.

Part 6 — solution

completely correct sum of digits in a loop and of sum initialised before loop

Mark points

  • Include the ideas shown in the solution above.

Part 6(b) — solution

Example solution – numeric version FUNCTION CheckNumber(Number : INTEGER) RETURNS BOOLEAN DECLARE Sum, CheckDigit, Remainder: INTEGER Remainder  Number MOD 10 Number  Number DIV 10 CheckDigit  Remainder Sum  0 WHILE Nummer > 0 Remainder  Number MOD 10 Number  Number DIV 10 Total  Total + Remainder ENDWHILE IF Total MOD 10 <> CheckDigit THEN RETURN FALSE ENDIF RETURN TRUE ENDFUNCTION

Mark points

  • Include the ideas shown in the solution above.

Part 6 — solution

completely correct sum of all digits in Number apart from least significant digit in loop

Mark points

  • Include the ideas shown in the solution above.

Part 6 — solution

... if true then increment Count in a loop

Mark points

  • Include the ideas shown in the solution above.

Question 7

Paper page 16 for Q7
Original paper page 16

Part 7 — solution

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

Mark points

  • Include the ideas shown in the solution above.

Part 7 — solution

Correct increment of array index by 1 and start position of substring by 4 Max 6 Alternative FOR loop solution: PROCEDURE Store() DECLARE Index, StartPos, ThisNum : INTEGER DECLARE ThisString : STRING StartPos  1 FOR Index  1 TO 20 ThisString  MID(NumString, StartPos, 3) ThisNum  STR_TO_NUM(ThisString) Data[Index]  ThisNum StartPos  StartPos + 4 IF StartPos > LENGTH(NumString) THEN Break ENDIF NEXT Index ENDPROCEDURE University Press & Assessment 2025 Page 8 of 17 9618/23 Cambridge International AS & A Level – Mark Scheme October/November PUBLISHED 2025

Mark points

  • Include the ideas shown in the solution above.

Part 7 — solution

Test for end of NumString and Break // Test for end of array and Break Max 6 University Press & Assessment 2025 Page 9 of 17 9618/23 Cambridge International AS & A Level – Mark Scheme October/November PUBLISHED 2025

Mark points

  • Include the ideas shown in the solution above.

Part 7 — solution

Otherwise concatenate next character from NumString to end of Substring Max 6 University Press & Assessment 2025 Page 10 of 17 9618/23 Cambridge International AS & A Level – Mark Scheme October/November PUBLISHED 2025

Mark points

  • Include the ideas shown in the solution above.

Part 7(a) — solution

Answer: 5

5 One mark for each:

Mark points

  • Correct result: 5

Part 7(b) — solution

Answer: 4

4 One mark for each:

Mark points

  • Correct result: 4

Part 7 — solution

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

Mark points

  • Include the ideas shown in the solution above.

Question 8

Paper page 18 for Q8
Original paper page 18

Part 8 — solution

Compare sum with final digit of parameter and return appropriate Boolean value Max 7 University Press & Assessment 2025 Page 12 of 17 9618/23 Cambridge International AS & A Level – Mark Scheme October/November PUBLISHED 2025

Mark points

  • Include the ideas shown in the solution above.

Part 8(a) — solution

  1. WHILE Index <= 8000 / 7999 AND NOT Found
  2. IF Loan[Index].StudentID = ThisStudentID AND
  3. Loan[Index].BookID = ThisBookID THEN
  4. IF Loan[Index].OnLoan = FALSE THEN

Mark points

  • WHILE Index <= 8000 / 7999 AND NOT Found
  • IF Loan[Index].StudentID = ThisStudentID AND
  • Loan[Index].BookID = ThisBookID THEN
  • IF Loan[Index].OnLoan = FALSE THEN

Part 8(b) — solution

  1. IF LEFT(Loan[Index].StudentID, 3) = TutorID AND
  2. Loan[Index].OnLoan = TRUE THEN

Mark points

  • IF LEFT(Loan[Index].StudentID, 3) = TutorID AND
  • Loan[Index].OnLoan = TRUE THEN

Part 8(c)(i) — solution

One mark per point: 2

Mark points

  • Include the ideas shown in the solution above.

Part 8(c)(ii) — solution

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

Mark points

  • Include the ideas shown in the solution above.

Part 8(c)(iii) — solution

One mark per point: 2 Benefit: Algorithm to store / extract a record is easier // unpacking of data is not required // No need for string concatenation Drawback: More file accesses needed (to read / write a complete record) University Press & Assessment 2025 Page 17 of 17

Mark points

  • Include the ideas shown in the solution above.