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

One mark per row 4 Variable use Data type Store the number of days in the current month INTEGER Store the first letter of the customer's first name CHAR Store an indication of whether a year is a leap BOOLEAN year Store the average amount spent per customer REAL visit

Mark points

  • Include the ideas shown in the solution above.

Part 1(b)(i) — solution

Easier to manage/plan/cost // Clear deliverables produced at (end of) each 1 stage

Mark points

  • Include the ideas shown in the solution above.

Part 1(b)(ii) — solution

  1. The problem definition
  2. Requirements specification // Client requirements
  3. Documentation related to current system (e.g. ER diagram of current

Mark points

  • The problem definition
  • Requirements specification // Client requirements
  • Documentation related to current system (e.g. ER diagram of current

Part 1(c)(i) — solution

  1. Modules are developed in parallel / as prototypes
  2. Minimal / no detailed planning is carried out // Allows for changes to
  3. Flexible development process
  4. Small incremental releases are made, each adding functionality
  5. Used for time critical development
  6. Client involved during (all stages) of development

Mark points

  • Modules are developed in parallel / as prototypes
  • Minimal / no detailed planning is carried out // Allows for changes to
  • Flexible development process
  • Small incremental releases are made, each adding functionality
  • Used for time critical development
  • Client involved during (all stages) of development

Part 1(c)(ii) — solution

  1. Quicker development possible / Multiple areas can be worked on at
  2. Prototype produced (at early stage in process)
  3. Easier to change requirements / quicker delivery of usable modules
  4. Early review possible / closer cooperation between client and
  5. Difficult to estimate cost / time to complete project
  6. Documentation often omitted
  7. Lack of client availability throughout life cycle // too easy for client to

Mark points

  • Quicker development possible / Multiple areas can be worked on at
  • Prototype produced (at early stage in process)
  • Easier to change requirements / quicker delivery of usable modules
  • Early review possible / closer cooperation between client and
  • Difficult to estimate cost / time to complete project
  • Documentation often omitted
  • Lack of client availability throughout life cycle // too easy for client to

Part 1(d) — solution

One mark for each point (Max 2) 2 Examples include:

Mark points

  • Include the ideas shown in the solution above.

Part 1 — solution

Declare two (REAL)variables for the two sum values AND initialise both to zero

Mark points

  • Include the ideas shown in the solution above.

Part 1 — solution

Procedure heading and ending including four parameters...

Mark points

  • Include the ideas shown in the solution above.

Part 1 — solution

Provides a mechanism to allow calling program to pass data

Mark points

  • Include the ideas shown in the solution above.

Part 1 — solution

The program is checked by creating a trace table / going through the program a line at a time

Mark points

  • Include the ideas shown in the solution above.

Part 1 — solution

300 290 315 'A'

Mark points

  • Include the ideas shown in the solution above.

Part 1 — solution

Function heading and ending including parameters

Mark points

  • Include the ideas shown in the solution above.

Part 1 — solution

Declaration and initialisation of local integer for Count

Mark points

  • Include the ideas shown in the solution above.

Part 1 — solution

(Conditional) loop terminating when item added OR end of array reached

Mark points

  • Include the ideas shown in the solution above.

Question 2

Paper page 4 for Q2
Original paper page 4

Part 2 — solution

New technologies available to host website // changes made to library modules used

Mark points

  • Include the ideas shown in the solution above.

Part 2 — solution

One mark for name and two marks for use (Max 3 in total): 3 Examples include: Module: SelectCharity() Use: Allows the user to choose a particular charity Module: SpecifyAmountAndType() Use: Allows the user to specify a single or regular payment Module: MakePayment() Use: Make payment to the charity Module: ValidatePayment() Use: Validate payment details (by accessing bank computer) Module: AddBankAccountDetails() / AddPaymentDetails() Use: Allows the user to add bank account information that donation to be taken from Module: AddDonorDetails() Use: Allows user to add details such as name and contact details

Mark points

  • Include the ideas shown in the solution above.

Part 2 — solution

...and use of BYREF for the three extracted values

Mark points

  • Include the ideas shown in the solution above.

Part 2 — solution

….to record/check variable (values) as they change

Mark points

  • Include the ideas shown in the solution above.

Part 2 — solution

> 317 290 315 'R'

Mark points

  • Include the ideas shown in the solution above.

Part 2 — solution

Declaration of local variable for Result / alt mechanism

Mark points

  • Include the ideas shown in the solution above.

Question 3

Paper page 5 for Q3
Original paper page 5

Part 3 — solution

Change in relevant legislation

Mark points

  • Include the ideas shown in the solution above.

Part 3 — solution

One mark per point, for example: 5

Mark points

  • Include the ideas shown in the solution above.

Part 3 — solution

If number greater than zero add to positive sum and If number less than zero add to negative sum

Mark points

  • Include the ideas shown in the solution above.

Part 3 — solution

Declare integer variable for FrontOfQueuePointer

Mark points

  • Include the ideas shown in the solution above.

Part 3 — solution

Error may be indicated when variable given an unexpected value

Mark points

  • Include the ideas shown in the solution above.

Part 3 — solution

317 290 315 'C'

Mark points

  • Include the ideas shown in the solution above.

Part 3 — solution

(Conditional) loop while error number input is in range // error code 999 reached

Mark points

  • Include the ideas shown in the solution above.

Part 3 — solution

Assignment of values to arrays // save index of first blank location and assign after loop

Mark points

  • Include the ideas shown in the solution above.

Question 4

Paper page 6 for Q4
Original paper page 6

Part 4(b)(i) — solution

Operation: Add an item / Enqueue 4 Check: There are unused elements in the array // The queue is not full Operation: Remove an item / Dequeue Check: There are items in the array // The queue is not empty One mark for reason and one mark for reason it could not be completed.

Mark points

  • Include the ideas shown in the solution above.

Part 4(b)(ii) — solution

One mark per point (Max 5): 5

Mark points

  • Include the ideas shown in the solution above.

Part 4 — solution

Declare integer variable for EndOfQueuePointer

Mark points

  • Include the ideas shown in the solution above.

Part 4 — solution

Error may be indicated by an unexpected path through the program // Faults in the logic of the program can be detected

Mark points

  • Include the ideas shown in the solution above.

Part 4 — solution

288 290 315 'C'

Mark points

  • Include the ideas shown in the solution above.

Part 4 — solution

Set loop termination if empty element found in a loop

Mark points

  • Include the ideas shown in the solution above.

Question 5

Paper page 7 for Q5
Original paper page 7

Part 5 — solution

After loop the Output SumPos and SumNeg

Mark points

  • Include the ideas shown in the solution above.

Part 5 — solution

Initialise FrontOfQueuePointer and EndOfQueuePointer to represent an empty queue

Mark points

  • Include the ideas shown in the solution above.

Part 5(a)(i) — solution

One mark per point: 6

Mark points

  • Include the ideas shown in the solution above.

Part 5 — solution

Calculation of length of SCost (remainder of string)

Mark points

  • Include the ideas shown in the solution above.

Part 5(a)(ii) — solution

One mark each (Max 2): 2

Mark points

  • Include the ideas shown in the solution above.

Part 5(b)(ii) — solution

  1. The new function will return an item of type StockItem
  2. Need to declare/use a (local) variable of type StockItem
  3. Costfield needs to be converted from a string to a real

Mark points

  • The new function will return an item of type StockItem
  • Need to declare/use a (local) variable of type StockItem
  • Costfield needs to be converted from a string to a real

Part 5(c) — solution

  1. Makes the code easier to understand // Describes the purpose of the
  2. White space
  3. Indentation
  4. Keywords in capitals
  5. Comments
  6. Local variables // parameters

Mark points

  • Makes the code easier to understand // Describes the purpose of the
  • White space
  • Indentation
  • Keywords in capitals
  • Comments
  • Local variables // parameters

Part 5(d) — solution

One mark per point (Max 3) 3

Mark points

  • Include the ideas shown in the solution above.

Part 5 — solution

Check for Recheck (or just default to third option)

Mark points

  • Include the ideas shown in the solution above.

Part 5 — solution

Check if this ErrCode needs to be output in a loop

Mark points

  • Include the ideas shown in the solution above.

Question 6

Paper page 10 for Q6
Original paper page 10

Part 6 — solution

Declare integer variable or NumberInQueue

Mark points

  • Include the ideas shown in the solution above.

Part 6 — solution

Extract and assign SCost following an attempt at MP5 PROCEDURE UnPack(BYVAL TLine : STRING, BYREF SID, SDesc, SCost : STRING) SID  LEFT(TLine, 5) SDesc  MID(TLine, 6, 32) SCost  RIGHT(TLine, LENGTH(TLine) – 37) ENDPROCEDURE

Mark points

  • Include the ideas shown in the solution above.

Part 6(a) — solution

One mark per row 5 Examples: Test Component Expected return Min Max number weight value

Mark points

  • Include the ideas shown in the solution above.

Part 6(b) — solution

One mark per point: 6

Mark points

  • Include the ideas shown in the solution above.

Part 6 — solution

  1. CONSTANT Accept = 'A'
  2. CONSTANT Reject = 'R'
  3. CONSTANT ReCheck = 'C'

Mark points

  • CONSTANT Accept = 'A'
  • CONSTANT Reject = 'R'
  • CONSTANT ReCheck = 'C'

Part 6 — solution

if so check for blank error text in a loop

Mark points

  • Include the ideas shown in the solution above.

Part 6 — solution

  1. CONSTANT Unused = 999
  2. IF ErrCode[Index] = Unused THEN

Mark points

  • CONSTANT Unused = 999
  • IF ErrCode[Index] = Unused THEN

Question 7

Paper page 12 for Q7
Original paper page 12

Part 7 — solution

Declare integer variable for SizeOfQueue to count / limit the max number of items allowed // Reference to mechanism for defining 'wrap' of circular queue

Mark points

  • Include the ideas shown in the solution above.

Part 7(a) — solution

One mark per point (Max 8): 8

Mark points

  • Include the ideas shown in the solution above.

Part 7(b)(i) — solution

One mark per point: 6

Mark points

  • Include the ideas shown in the solution above.

Part 7(b)(ii) — solution

One mark per point (Max 3): 3 1. Loop through 500 elements (while error number not found) 2. Compare ErrCode for current element with the error number 3. If same, set element value to 999 (and terminate loop) 4. ... and call SortArrays() (to move 999 to the end) – once only 2022 Page 9 of 9

Mark points

  • Include the ideas shown in the solution above.

Question 8

Part 8 — solution

Initialise SizeOfQueue // Initialise NumberInQueue

Mark points

  • Include the ideas shown in the solution above.

Question 9

Part 9 — solution

  1. IF ThisErr >= First THEN
  2. IF ThisMess = "" THEN

Mark points

  • IF ThisErr >= First THEN
  • IF ThisMess = "" THEN