9618/23 · October/November 2024 · 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 Safe[Index] = TRUE THEN
  2. REPEAT UNTIL AllDone() = TRUE  

Mark points

  • IF Safe[Index] = TRUE THEN
  • REPEAT UNTIL AllDone() = TRUE  

Part 1(b) — solution

Answer: 3

3 Variable Example data value Data type Available TRUE BOOLEAN Received "18/04/2021" STRING Index 100 INTEGER One mark per row

Mark points

  • Correct result: 3

Part 1(c) — solution

Answer: 3

3 Expression Evaluates to Available AND NOT(Index > 100) TRUE Index MOD 30 10 NUM_TO_STR(Index + "33") ERROR One mark per row University Press & Assessment 2024 Page 4 of 14 9618/23 Cambridge International AS & A Level – Mark Scheme October/November PUBLISHED 2024

Mark points

  • Correct result: 3

Question 2

Part 2(a) — solution

  1. MP4 Test for value > 0 // >=1 in a loop

Mark points

  • MP4 Test for value > 0 // >=1 in a loop

Part 2(b) — solution

MP1 Construct: Iteration / Repetition 2 MP2 Use: To loop through all 100 inputs // To loop 100 times ALTERNATIVE: MP1 Construct: Selection MP2 Use: To test whether the value input is positive

Mark points

  • Include the ideas shown in the solution above.

Question 3

Paper page 4 for Q3
Original paper page 4

Part 3(a)(i) — solution

0 is not a valid array / List index value // No 0th element in the array 1

Mark points

  • Include the ideas shown in the solution above.

Part 3(b) — solution

Answer: 4

4 Mark as follows: MP1 Use of variable as array index and initialisation to 1 / to first element of array MP2 Loop for 199 / 200 iterations MP3 Assign Index+1 to each pointer field in a loop MP4 Assign 0 to 200th pointer field University Press & Assessment 2024 Page 6 of 14 9618/23 Cambridge International AS & A Level – Mark Scheme October/November PUBLISHED 2024

Mark points

  • Correct result: 4

Part 3(c) — solution

One mark per step: 4 MP1 Assign HeadPointer to ThisPointer / Current Pointer // Identify first node using headpointer MP2 Loop the following until ThisPointer value is 0 (zero) / null pointer reached MP3 … Output data (field) from array element at index ThisPointer // Output data (field) of the current node / array element MP4 … Assign pointer field from current array element / index / to ThisPointer / Current Pointer // Assign pointer field from current node to ThisPointer / Current Pointer

Mark points

  • Include the ideas shown in the solution above.

Question 4

Paper page 8 for Q4
Original paper page 8

Part 4(a) — solution

  1. IF Mark >= Lower AND Mark <= Upper THEN
  2. //IF Mark <= Upper AND Mark >= Lower THEN

Mark points

  • IF Mark >= Lower AND Mark <= Upper THEN
  • //IF Mark <= Upper AND Mark >= Lower THEN

Part 4(b)(i) — solution

MP1 Use Mark as the index to the Check array // to specify an array 2 element MP2 If value of indexed element is TRUE, then the paper will need to be checked University Press & Assessment 2024 Page 7 of 14 9618/23 Cambridge International AS & A Level – Mark Scheme October/November PUBLISHED 2024

Mark points

  • Include the ideas shown in the solution above.

Part 4(b)(ii) — solution

Example:solution 6 PROCEDURE GBInitialise() DECLARE GBIndex, GBMark, ThisIndex : INTEGER FOR ThisIndex  0 TO 75 Check[ThisIndex]  FALSE // initialise all values NEXT ThisIndex FOR GBIndex  1 TO 5 GBMark  GB[GBIndex] FOR ThisIndex  GBMark - 2 TO GBMark + 2 Check[ThisIndex]  TRUE //Set GBMark  2 to TRUE NEXT ThisIndex NEXT GBIndex ENDPROCEDURE Mark as follows: MP1 Procedure heading and ending MP2 Initialise Check array to FALSE MP3 Loop through GB array MP4 Extract the GB mark MP5 Loop for 5 elements across GBMark  2 // Check if within GBMark 2 MP6 Assign each element of Check array to TRUE ALTERNATIVE – Example using selection Version 1 FOR ThisIndex  0 TO 75 CASE ThisIndex GB[1] – 2 TO GB[1] + 2 : Check[ThisIndex]  TRUE GB[2] – 2 TO GB[2] + 2 : Check[ThisIndex]  TRUE GB[3] – 2 TO GB[3] + 2 : Check[ThisIndex]  TRUE GB[4] – 2 TO GB[4] + 2 : Check[ThisIndex]  TRUE GB[5] – 2 TO GB[5] + 2 : Check[ThisIndex]  TRUE OTHERWISE: Check[ThisIndex]  FALSE ENDCASE NEXT ThisIndex University Press & Assessment 2024 Page 8 of 14 9618/23 Cambridge International AS & A Level – Mark Scheme October/November PUBLISHED 2024

Mark points

  • Include the ideas shown in the solution above.

Part 4(b)(ii) — solution

  1. IF ThisIndex >= Lower AND ThisIndex <= Higher

Mark points

  • IF ThisIndex >= Lower AND ThisIndex <= Higher

Question 5

Paper page 10 for Q5
Original paper page 10

Part 5(a) — solution

Answer: 4

4 Name of life Activity cycle stage A compiler is be used. Coding A program that has been released for general use Maintenance is modified The dry run method is used. Testing The program structure is specified. Design One mark per row

Mark points

  • Correct result: 4

Part 5(b) — solution

One mark for method – two marks for the description 3 MP1 Stub testing MP2 The modules Test_A() and Test_B()are replaced by dummy modules MP3 ... which return a known result // An output statement is displayed when called (to check it works) // gives expected output University Press & Assessment 2024 Page 9 of 14 9618/23 Cambridge International AS & A Level – Mark Scheme October/November PUBLISHED 2024

Mark points

  • Include the ideas shown in the solution above.

Question 6

Part 6 — solution

  1. IF DAYINDEX(ThisDate) = 1 THEN
  2. UNTIL SundayCount = 3
  3. IF FirstDayIndex = 1 THEN

Mark points

  • IF DAYINDEX(ThisDate) = 1 THEN
  • UNTIL SundayCount = 3
  • IF FirstDayIndex = 1 THEN

Part 6 — solution

Mark as follows: MP1 Function heading, parameter, ending and return type MP2 Declare local integer variable that is used to hold a day number MP4 Attempt to use both SETDATE() and DAYINDEX() MP5 Correctly generate value of type DATE using SETDATE() for first of March / specific day in March MP6 Test if date represents a Sunday / specific day using DAYINDEX() and calculate third Sunday // Correctly calculate third Sunday for a value returned by DAYINDEX()for one day MP7 Calculate third Sunday for other six days MP8 Return day number of third Sunday Max 7 marks

Mark points

  • Include the ideas shown in the solution above.

Question 7

Paper page 12 for Q7
Original paper page 12

Part 7(a) — solution

  1. A requirement specification
  2. Definition of System Objectives
  3. List of problems with existing system
  4. Survey results
  5. Feasibility study
  6. Interview notes

Mark points

  • A requirement specification
  • Definition of System Objectives
  • List of problems with existing system
  • Survey results
  • Feasibility study
  • Interview notes

Part 7(b) — solution

One mark for name and use 4 Mark as follows: Examples include: Sub-module: ScanCard()/ GetID() Use: Read the barcode from the loyalty card / Get the customer ID from the barcode Sub-module: GetPoints() Use: Get the number of points the customer has Sub-module: ExchangePoints() / UpdateCard() Use: Reduce the number of loyalty points Sub-module: GetDiscount() / CalculateDiscount() Use: Calculate the discount Sub-module: CalculatePoints() Use: Calculate points (following a purchase) Sub-module: UpdatePoints() Use: Update total points a customer has (following a purchase) Sub-module: ShowDiscount() Use: Display the discount Max 4 marks University Press & Assessment 2024 Page 12 of 14 9618/23 Cambridge International AS & A Level – Mark Scheme October/November PUBLISHED 2024

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 Character[Index].Player = ThisPlayer AND __
  2. Character[Index].Role = ThisRole THEN

Mark points

  • IF Character[Index].Player = ThisPlayer AND __
  • Character[Index].Role = ThisRole THEN

Part 8(b) — solution

Example solution: 7 PROCEDURE Restore() DECLARE Index : INTEGER DECLARE Line : STRING OPENFILE "SaveFile.txt" FOR READ FOR Index  1 TO 45 READFILE "SaveFile.txt", Line Character[Index].Player  STR_TO_NUM(Extract(Line, 1)) Character[Index].Role  Extract(Line, 2) Character[Index].Name  Extract(Line, 3) Character[Index].Skill  STR_TO_NUM(Extract(Line, 4)) NEXT Index CLOSEFILE "SaveFile.txt" ENDPROCEDURE Mark as follows: MP1 Open the file in read mode and subsequently close MP2 Loop through 45 elements MP3 Read a line from the file in a loop MP4 Attempt to use Extract() in a loop MP5 Correct use of Extract() for all fields in a loop MP6 Use of STR_TO_NUM() on Player and Skill in a loop MP7 Completely correct extraction and assignment of all fields in a loop

Mark points

  • Include the ideas shown in the solution above.

Part 8(c) — solution

MP1 The Character array / character data can be saved before the 2 program is closed MP2 Allowing the game to continue using the same data / from the point it was saved University Press & Assessment 2024 Page 14 of 14

Mark points

  • Include the ideas shown in the solution above.