Computer Science (9618) · Oct/Nov 2022 · Mark scheme 23

Cambridge Computer Science (9618) mark scheme for paper 23, Oct/Nov 2022 — 9618/23/O/N/22, file 9618_w22_ms_23.pdf.

Advertisement
Loading the paper…
Text of this paper

Cambridge International AS & A Level
COMPUTER SCIENCE

9618/23

Paper 2 Problem Solving & Programming

October/November 2022

MARK SCHEME
Maximum Mark: 75

Published

This mark scheme is published as an aid to teachers and candidates, to indicate the requirements of the
examination. It shows the basis on which Examiners were instructed to award marks. It does not indicate the
details of the discussions that took place at an Examiners’ meeting before marking began, which would have
considered the acceptability of alternative answers.
Mark schemes should be read in conjunction with the question paper and the Principal Examiner Report for
Teachers.
Cambridge International will not enter into discussions about these mark schemes.
Cambridge International is publishing the mark schemes for the October/November 2022 series for most
Cambridge IGCSE™, Cambridge International A and AS Level components and some Cambridge O Level
components.

This document consists of 9 printed pages.
© UCLES 2022

[Turn over

9618/23

Cambridge International AS & A Level – Mark Scheme
PUBLISHED

October/November
2022

Generic Marking Principles
These general marking principles must be applied by all examiners when marking candidate answers.
They should be applied alongside the specific content of the mark scheme or generic level descriptors
for a question. Each question paper and mark scheme will also comply with these marking principles.
GENERIC MARKING PRINCIPLE 1:
Marks must be awarded in line with:
•
•
•

the specific content of the mark scheme or the generic level descriptors for the question
the specific skills defined in the mark scheme or in the generic level descriptors for the question
the standard of response required by a candidate as exemplified by the standardisation scripts.

GENERIC MARKING PRINCIPLE 2:
Marks awarded are always whole marks (not half marks, or other fractions).
GENERIC MARKING PRINCIPLE 3:
Marks must be awarded positively:
•
•
•
•
•

marks are awarded for correct/valid answers, as defined in the mark scheme. However, credit
is given for valid answers which go beyond the scope of the syllabus and mark scheme,
referring to your Team Leader as appropriate
marks are awarded when candidates clearly demonstrate what they know and can do
marks are not deducted for errors
marks are not deducted for omissions
answers should only be judged on the quality of spelling, punctuation and grammar when these
features are specifically assessed by the question as indicated by the mark scheme. The
meaning, however, should be unambiguous.

GENERIC MARKING PRINCIPLE 4:
Rules must be applied consistently, e.g. in situations where candidates have not followed
instructions or in the application of generic level descriptors.
GENERIC MARKING PRINCIPLE 5:
Marks should be awarded using the full range of marks defined in the mark scheme for the question
(however; the use of the full mark range may be limited according to the quality of the candidate
responses seen).
GENERIC MARKING PRINCIPLE 6:
Marks awarded are based solely on the requirements as defined in the mark scheme. Marks should
not be awarded with grade thresholds or grade descriptors in mind.

© UCLES 2022

Page 2 of 9

Cambridge International AS & A Level – Mark Scheme
PUBLISHED

9618/23

Question
1(a)

October/November
2022

Answer

Marks
4

One mark per row
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
year

BOOLEAN

Store the average amount spent per customer
visit

REAL

1(b)(i)

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

1

1(b)(ii)

One mark per point (Max 1):

1

•
•
•
1(c)(i)

One mark per point (Max 1):
•
•
•
•
•
•

1(c)(ii)

The problem definition
Requirements specification // Client requirements
Documentation related to current system (e.g. ER diagram of current
system, DFD of current system, feasibility study)
1

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

Examples include:

3

Benefits: (Max 2 marks)
• Quicker development possible / Multiple areas can be worked on at
same time
• Prototype produced (at early stage in process)
• Easier to change requirements / quicker delivery of usable modules
• Early review possible / closer cooperation between client and
developers
Drawback: (Max 1 mark)
• Difficult to estimate cost / time to complete project
• Documentation often omitted
• Lack of client availability throughout life cycle // too easy for client to
keep changing their mind

© UCLES 2022

Page 3 of 9

Cambridge International AS & A Level – Mark Scheme
PUBLISHED

9618/23

Question
1(d)

October/November
2022

Answer
One mark for each point (Max 2)

Marks
2

Examples include:
1
2
3

Change to website requirements
New technologies available to host website // changes made to library
modules used
Change in relevant legislation

Question
2

Answer
One mark for name and two marks for use (Max 3 in total):

Marks
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

Question
3

Answer
One mark per point, for example:
1
2
3
4
5

Question
4(a)

© UCLES 2022

Marks
5

Declare two (REAL)variables for the two sum values AND initialise both
to zero
Prompt AND Input a number
If number greater than zero add to positive sum and If number less
than zero add to negative sum
Repeat from step 2 if number not zero
After loop the Output SumPos and SumNeg

Answer
The data type (of the item to be stored)

Page 4 of 9

Marks
1

Cambridge International AS & A Level – Mark Scheme
PUBLISHED

9618/23

Question
4(b)(i)

October/November
2022

Answer
Operation: Add an item / Enqueue
Check: There are unused elements in the array // The queue is not full

Marks
4

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.
4(b)(ii)

One mark per point (Max 5):
1
2
3
4
5
6
7

8

Declare a (1D) array of size >= 10
…of data type CHAR
Declare integer variable for FrontOfQueuePointer
Declare integer variable for EndOfQueuePointer
Initialise FrontOfQueuePointer and EndOfQueuePointer to
represent an empty queue
Declare integer variable or NumberInQueue
Declare integer variable for SizeOfQueue to count / limit the max
number of items allowed // Reference to mechanism for defining 'wrap'
of circular queue
Initialise SizeOfQueue // Initialise NumberInQueue

Question
5(a)(i)

5

Answer
One mark per point:
1
2
3
4
5
6

Marks
6

Procedure heading and ending including four parameters...
...and use of BYREF for the three extracted values
Extract and assign SID
Extract and assign SDesc
Calculation of length of SCost (remainder of string)
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
5(a)(ii)

One mark each (Max 2):
1
2
3

5(b)(i)

© UCLES 2022

2

Provides a mechanism to allow calling program to pass data
Defines the four parameters of Unpack()
… giving their data type and order

LineData.Cost  12.99

1

Page 5 of 9

Cambridge International AS & A Level – Mark Scheme
PUBLISHED

9618/23

Question
5(b)(ii)

Answer

Marks

One mark per point (Max 2):
•
•
•

5(c)

October/November
2022

2

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

One mark for reason
One mark for each example (Max 2)

3

Reason:
• Makes the code easier to understand // Describes the purpose of the
identifier // Makes the code easier to debug/test/maintain
Further examples include:
• White space
• Indentation
• Keywords in capitals
• Comments
• Local variables // parameters
5(d)

One mark per point (Max 3)
1
2
3
4

The program is checked by creating a trace table / going through the
program a line at a time
….to record/check variable (values) as they change
Error may be indicated when variable given an unexpected value
Error may be indicated by an unexpected path through the program //
Faults in the logic of the program can be detected

Question
6(a)

3

Answer

Marks

One mark per row

5

Examples:
Test
number

© UCLES 2022

Component
weight

Min

Max

Expected return
value

1

300

290

315

'A'

2

> 317

290

315

'R'

3

317

290

315

'C'

4

288

290

315

'C'

5

< 288

290

315

'R'

Page 6 of 9

Cambridge International AS & A Level – Mark Scheme
PUBLISHED

9618/23

Question
6(b)

October/November
2022

Answer
One mark per point:
1
2
3
4
5
6

6

Function heading and ending including parameters
Declaration of local variable for Result / alt mechanism
Check for Reject
Check for Accept
Check for Recheck (or just default to third option)
Return Result following a reasonable attempt

Function Status(Actual, Min, Max : INTEGER) RETURNS CHAR
DECLARE Result : CHAR
CONSTANT Accept = 'A'
CONSTANT Reject = 'R'
CONSTANT ReCheck = 'C'
Result  ReCheck
//Check if reject
IF Actual > Max + 2 OR Actual < Min – 2 THEN
Result  Reject
ENDIF
//Check if acceptable
IF Actual < Max - 2 AND Actual > Min + 2 THEN
Result  Accept
ENDIF
RETURN Result
ENDFUNCTION

© UCLES 2022

Marks

Page 7 of 9

Cambridge International AS & A Level – Mark Scheme
PUBLISHED

9618/23

Question
7(a)

October/November
2022

Answer
One mark per point (Max 8):
1
2
3
4
5
6
7
8
9

8

Declaration and initialisation of local integer for Count
Appropriate prompt and two inputs
(Conditional) loop while error number input is in range // error code 999
reached
…and not end of array
Check if this ErrCode needs to be output in a loop
if so check for blank error text in a loop
Output in both cases
….and increment count in a loop
OUTPUT of header and summary including count

PROCEDURE
DECLARE
DECLARE
DECLARE

OutputRange()
First, Last, Count, Index, ThisErr : INTEGER
ThisMess : STRING
PastLast: BOOLEAN

Count  0
Index  1
PastLast  FALSE
OUTPUT "Please input first error number: "
INPUT First
OUTPUT "Please input last error number: "
INPUT Last
OUTPUT "List of error numbers from ", First, " to ",
Last
WHILE Index < 501 AND NOT PastLast
ThisErr  ErrCode[Index]
IF ThisErr > Last THEN
PastLast  TRUE
ELSE
IF ThisErr >= First THEN
ThisMess  ErrText[Index]
IF ThisMess = "" THEN
ThisMess  "Error Text Missing"
ENDIF
OUTPUT ThisErr, " : ", ThisMess
Count  Count + 1
ENDIF
ENDIF
Index  Index + 1
ENDWHILE
OUTPUT Count, " error numbers output"
ENDPROCEDURE

© UCLES 2022

Marks

Page 8 of 9

Cambridge International AS & A Level – Mark Scheme
PUBLISHED

9618/23

Question
7(b)(i)

October/November
2022

Answer
One mark per point:
1
2
3
4
5
6

Marks
6

(Conditional) loop terminating when item added OR end of array
reached
Test for unused element in a loop
Assignment of values to arrays // save index of first blank location and
assign after loop
Set loop termination if empty element found in a loop
Call SortArrays() once
Calculation of remaining unused elements and return Integer value (for
both cases)

FUNCTION AddError(ErrNum : INTEGER, ErrMess : STRING)
RETURNS INTEGER
DECLARE Index, Remaining : INTEGER
CONSTANT Unused = 999
Index  1
Remaining  -1
REPEAT
IF ErrCode[Index] = Unused THEN
ErrCode[Index]  ErrNum
ErrText[Index]  ErrMess
CALL SortArrays()
Remaining  500 – Index
ENDIF
Index  Index + 1
UNTIL Remaining <> -1 OR Index > 500
RETURN Remaining
ENDFUNCTION
7(b)(ii)

One mark per point (Max 3):
1.
2.
3.
4.

© UCLES 2022

3

Loop through 500 elements (while error number not found)
Compare ErrCode for current element with the error number
If same, set element value to 999 (and terminate loop)
... and call SortArrays() (to move 999 to the end) – once only

Page 9 of 9

Advertisement