9618/23 · October/November 2023 · 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

4 Assignment statement Data type MyVar1  Total1 / Total2 REAL MyVar2  27/10/2023 DATE MyVar3  "Sum1 / Sum2" STRING MyVar4  Result1 AND Result2 BOOLEAN

Mark points

  • Correct result: 4

Part 1(b) — solution

Answer: 4

  1. Fraction >= 0.2 AND NOT Active FALSE

Mark points

  • Fraction >= 0.2 AND NOT Active FALSE

Part 1(c) — solution

The use of a program library (routines) 1

Mark points

  • Include the ideas shown in the solution above.

Part 1(d) — solution

MP1 Type: Adaptive 2 MP2 Reason: The (user) requirement(s) changes // to accommodate legislative changes 2023 Page 4 of 11 9618/23 Cambridge International AS & A Level – Mark Scheme October/November PUBLISHED 2023

Mark points

  • Include the ideas shown in the solution above.

Part 1 — solution

GetData() does not return a value until a message has been received

Mark points

  • Include the ideas shown in the solution above.

Question 2

Paper page 4 for Q2
Original paper page 4

Part 2(a) — solution

Answer: 5

5 MP1 Initialise Min to first value in Data and MinIndex to 1 MP2 Loop through 29 more values (or 30 values in total) MP3 Compare element from Data[] with Min MP4 Set new Min AND save MinIndex when element value < Min in a loop MP5 Output MinIndex

Mark points

  • Correct result: 5

Part 2(b) — solution

MP1 Simplifies the algorithm // easier to write / understand / test / debug 2 MP2 It is possible to iterate through the values // can use a loop // allows the storage of many values using a single identifier

Mark points

  • Include the ideas shown in the solution above.

Part 2(c) — solution

One mark per underlined section 2 DECLARE Data : ARRAY[1:120] OF REAL 2023 Page 5 of 11 9618/23 Cambridge International AS & A Level – Mark Scheme October/November PUBLISHED 2023

Mark points

  • Include the ideas shown in the solution above.

Part 2 — solution

So once a message has been sent the user has to wait for a reply // chat is half-duplex Modification:

Mark points

  • Include the ideas shown in the solution above.

Question 3

Paper page 6 for Q3
Original paper page 6

Part 3(a) — solution

Answer: 3

3 : MP1 D3, D4, D1, D2 and D5 in question order or reversed - in any five consecutive locations MP2 FoQ value matches index with D3 MP3 EoQ value matches index with D5

Mark points

  • Correct result: 3

Part 3(b) — solution

  1. MP1 If NumItems is / = 8 // (queue) full then jump to step 6 6
  2. MP3 If EndOfQueue = 9 then set EndOfQueue to 1

Mark points

  • MP1 If NumItems is / = 8 // (queue) full then jump to step 6 6
  • MP3 If EndOfQueue = 9 then set EndOfQueue to 1

Part 3 — solution

If no response allow the receiver to exit chat at any time …

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. CONSTANT StepVal = 10

Mark points

  • CONSTANT StepVal = 10

Part 4(b) — solution

  1. MP1 Result[x + 1] <= Result[x]
  2. Result[x] >= Result[x + 1]

Mark points

  • MP1 Result[x + 1] <= Result[x]
  • Result[x] >= Result[x + 1]

Part 4 — solution

GetData() should immediately return a suitable message // set a time limit

Mark points

  • Include the ideas shown in the solution above.

Question 5

Paper page 10 for Q5
Original paper page 10

Part 5 — solution

Answer: 6

  1. MP6 5 – Total 28 and final Mix[1] = 56

Mark points

  • MP6 5 – Total 28 and final Mix[1] = 56

Part 5 — solution

... which Chat() can detect and respond by allowing the conversation to continue 2023 Page 11 of 11

Mark points

  • Include the ideas shown in the solution above.

Question 6

Paper page 12 for Q6
Original paper page 12

Part 6 — solution

Answer: 6 · AND MID(ThisNum, 5, 1) = MID(ThisNum, 6, 1) THEN

  1. IF LEFT(ThisNum,3) = RIGHT(ThisNum 3) THEN
  2. IF RIGHT(ThisNum, 3) = "000" THEN
  3. IF MID(ThisNum, 4, 1) = MID(ThisNum, 5, 1)__
  4. AND MID(ThisNum, 5, 1) = MID(ThisNum, 6, 1) THEN

Mark points

  • IF LEFT(ThisNum,3) = RIGHT(ThisNum 3) THEN
  • IF RIGHT(ThisNum, 3) = "000" THEN
  • IF MID(ThisNum, 4, 1) = MID(ThisNum, 5, 1)__
  • AND MID(ThisNum, 5, 1) = MID(ThisNum, 6, 1) THEN

Question 7

Paper page 14 for Q7
Original paper page 14

Part 7(a) — solution

MP1 iteration / looping 2 MP2 naming all four modules correctly in the correct sequence // e.g. Module-A repeatedly calls Sub-Y1,then SubY2 then Sub-9

Mark points

  • Include the ideas shown in the solution above.

Part 7(b)(i) — solution

TYPE MyType 3 DECLARE RA : INTEGER DECLARE RB : STRING DECLARE RC : BOOLEAN ENDTYPE MP1 TYPE MyType... ENDTYPE MP2 RA as integer and RB3 as string MP3 RC as Boolean

Mark points

  • Include the ideas shown in the solution above.

Part 7(b)(ii) — solution

PROCEDURE Sub-9(BYREF Param : MyType) 2 MP 1 One mark for BYREF MP 2 One mark for the rest of the statement 2023 Page 9 of 11 9618/23 Cambridge International AS & A Level – Mark Scheme October/November PUBLISHED 2023

Mark points

  • Include the ideas shown in the solution above.

Question 8

Paper page 16 for Q8
Original paper page 16

Part 8(a) — solution

  1. CONSTANT Terminator = "****"

Mark points

  • CONSTANT Terminator = "****"

Part 8(b) — solution

  1. If the file being sent contains a line of the string "****"
  2. then the file being written by ReceiveFile() will end at this point //
  3. Read the file (at the sending end) to find the number of lines it contains
  4. Send an initial message which defines the number of lines in the file
  5. (Transmitter program) chooses a different terminator string / character
  6. Transmitter program sends the terminator string / character before first

Mark points

  • If the file being sent contains a line of the string "****"
  • then the file being written by ReceiveFile() will end at this point //
  • Read the file (at the sending end) to find the number of lines it contains
  • Send an initial message which defines the number of lines in the file
  • (Transmitter program) chooses a different terminator string / character
  • Transmitter program sends the terminator string / character before first

Part 8(c) — solution

  1. CONSTANT Terminator = "Bye"
  2. CONSTANT STX = CHR(2)
  3. CONSTANT ETX = CHR(3)
  4. IF Data = Terminator THEN
  5. IF Data = Terminator THEN
  6. UNTIL Finished = TRUE

Mark points

  • CONSTANT Terminator = "Bye"
  • CONSTANT STX = CHR(2)
  • CONSTANT ETX = CHR(3)
  • IF Data = Terminator THEN
  • IF Data = Terminator THEN
  • UNTIL Finished = TRUE

Part 8(d) — solution

Note: Max 3 marks (from either limitation or modification list) 3 Limitation:

Mark points

  • Include the ideas shown in the solution above.