9618/22 · 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

Answer: 4

  1. IF Status = FALSE THEN
  2. WHILE AllDone() = TRUE

Mark points

  • IF Status = FALSE THEN
  • WHILE AllDone() = TRUE

Part 1(b) — solution

Answer: 3

3 Variable Example data value Data type Result 5.42 REAL MonthLetter "JFMAMJJASOND" STRING Birthday 15/11/2009 DATE One mark per row

Mark points

  • Correct result: 3

Part 1(c) — solution

Answer: 4

4 Expression Evaluates to INT(Result) + 1 > 6 FALSE NUM_TO_STR(LENGTH(MonthLetter)) "12" NUM_TO_STR(Result + "3.2") ERROR MID(MonthLetter, MONTH(Birthday) — 2, 1) "S" One mark per row University Press & Assessment 2025 Page 5 of 15 9618/22 Cambridge International AS & A Level – Mark Scheme October/November PUBLISHED 2025

Mark points

  • Correct result: 4

Question 2

Part 2 — solution

Answer: 5

5 Mark as follows: MP1 Initialisation of the array index MP2 Input number in a loop MP3 Test for termination value (99.9) and correct ending MP4 Test for array full / maximum 20 iterations and correct ending MP5 Assign number to Data array element and increment index University Press & Assessment 2025 Page 6 of 15 9618/22 Cambridge International AS & A Level – Mark Scheme October/November PUBLISHED 2025

Mark points

  • Correct result: 5

Question 3

Paper page 4 for Q3
Original paper page 4

Part 3(a) — solution

Mark as follows: 6 MP1 1 open the file OldFile.txt in read (mode) MP2 2 open the file NewFile.txt in write (mode)

Mark points

  • Include the ideas shown in the solution above.

Part 3 — solution

read a line from OldFile.txt and store in LineX MP3 4 read a line from OldFile.txt and store in LineY

Mark points

  • Include the ideas shown in the solution above.

Part 3(b) — solution

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

Mark points

  • Include the ideas shown in the solution above.

Part 3(c) — solution

MP1 Add a (single) new separator at the end of the third (original) item 3 MP2 Calculate the length of both new data items MP3 Store / append the length (of the new each items) MP4 as a fixed length / separated digit string // by example Max 3 University Press & Assessment 2025 Page 8 of 15 9618/22 Cambridge International AS & A Level – Mark Scheme October/November PUBLISHED 2025

Mark points

  • Include the ideas shown in the solution above.

Question 4

Paper page 6 for Q4
Original paper page 6

Part 4(a) — solution

Example solution: 4 DECLARE CheckTotal : ARRAY [0:35] OF BOOLEAN DECLARE Index : INTEGER FOR Index  0 TO 35 CheckTotal[Index]  FALSE NEXT Index Mark as follows: MP1 Declaration of CheckTotal array MP2 Declaration of a loop counter MP3 Loop – with correct syntax and number of iterations MP4 Assignment of array element to FALSE

Mark points

  • Include the ideas shown in the solution above.

Part 4(b) — solution

Answer: 5

5 DECLARE EasyQ, HardQ : INTEGER FOR EasyQ  0 TO 15 STEP 3 MP1 MP2 FOR HardQ  0 TO 20 STEP 5 MP3 MP4 CheckTotal[HardQ + EasyQ]  TRUE NEXT HardQ MP5 NEXT EasyQ Mark as follows: One mark per gap (boldened)

Mark points

  • Correct result: 5

Part 4(c) — solution

MP1 Check that the parameter value is in the range 0 to 35 4 MP2 ... and if not, return FALSE MP3 Use the parameter value as the index to array CheckTotal MP4 Return the value from given index position University Press & Assessment 2025 Page 9 of 15 9618/22 Cambridge International AS & A Level – Mark Scheme October/November PUBLISHED 2025

Mark points

  • Include the ideas shown in the solution above.

Question 5

Paper page 8 for Q5
Original paper page 8

Part 5 — solution

read a line from OldFile.txt and store in LineZ MP4 6 set NewString to LineX & '\' & LineY & '\' & LineZ MP5 7 write NewString to NewFile.txt MP6 8 repeat from step 3 until end of OldFile.txt

Mark points

  • Include the ideas shown in the solution above.

Part 5(a) — solution

Answer: 4

4 Activity Name of life cycle stage a structure chart is produced Design a program is modified to allow it to run on new Maintenance hardware the programmer identifies the customer's Analysis requirements an Integrated Development Environment (IDE) Coding provides context-sensitive help such as 'auto- complete' One mark per row

Mark points

  • Correct result: 4

Question 6

Paper page 10 for Q6
Original paper page 10

Part 6 — solution

  1. DECLARE S1Length : INTEGER
  2. S1Length  LENGTH(String1)
  3. IF LENGTH(String2) < S1Length THEN
  4. IF CaseMatters = FALSE THEN
  5. 'e' : String2  RIGHT(String2, S1Length)
  6. 's' : String2  LEFT(String2, S1Length)
  7. IF String1 = String2 THEN

Mark points

  • DECLARE S1Length : INTEGER
  • S1Length  LENGTH(String1)
  • IF LENGTH(String2) < S1Length THEN
  • IF CaseMatters = FALSE THEN
  • 'e' : String2  RIGHT(String2, S1Length)
  • 's' : String2  LEFT(String2, S1Length)
  • IF String1 = String2 THEN

Question 7

Paper page 12 for Q7
Original paper page 12

Part 7(a) — solution

Example explanation: 2 The arrow means that Convert repeatedly calls Analyse then Update and then Sort (in that order)10 MP1 Reference to ‘repetition’…’ MP2 Naming all four modules correctly and the sequence is stated or implied

Mark points

  • Include the ideas shown in the solution above.

Part 7(b) — solution

MP1 PROCEDURE Analyse (Count : INTEGER) 4 FUNCTION Update (Key : STRING) RETURNS INTEGER MP2 MP3 MP4 PROCEDURE Sort (BYREF P2 : BOOLEAN) Mark as follows: One mark per underlined part University Press & Assessment 2025 Page 12 of 15 9618/22 Cambridge International AS & A Level – Mark Scheme October/November PUBLISHED 2025

Mark points

  • Include the ideas shown in the solution above.

Question 8

Paper page 14 for Q8
Original paper page 14

Part 8(a) — solution

  1. IF Loan[Index].StudentID = ThisStudentID THEN
  2. IF Loan[Index].OnLoan = FALSE THEN
  3. MP4 Attempt to compare the StudentID field = parameter in a loop

Mark points

  • IF Loan[Index].StudentID = ThisStudentID THEN
  • IF Loan[Index].OnLoan = FALSE THEN
  • MP4 Attempt to compare the StudentID field = parameter in a loop

Part 8(b) — solution

  1. CONSTANT Blank = ""
  2. WHILE Index <= 7000 AND NOT IsStored
  3. IF Loan[Index].StudentID = Blank THEN
  4. MP4 Test if record is unused (.StudentID = "")in a loop
  5. IF Loan[Index].StudentID = Blank THEN

Mark points

  • CONSTANT Blank = ""
  • WHILE Index <= 7000 AND NOT IsStored
  • IF Loan[Index].StudentID = Blank THEN
  • MP4 Test if record is unused (.StudentID = "")in a loop
  • IF Loan[Index].StudentID = Blank THEN

Part 8(c) — solution

MP1 Save to/Open a (text) file 2 MP2 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

Mark points

  • Include the ideas shown in the solution above.

Part 8(d) — solution

Answer: OR

Additional date(s) solution 2 MP1 Store the return date of each loan // the start date and the loan period MP2 Algorithm will do a calculation involving the MP1 data item(s) OR The student email address solution MP3 Store the student email address MP4 In order to send the email // the student is alerted to return the book Max 2 University Press & Assessment 2025 Page 15 of 15

Mark points

  • Correct result: OR

Question 30

Part 30 — solution

: NextChar  'X'  One mark per row

Mark points

  • Include the ideas shown in the solution above.