Computer Science (9618) · Oct/Nov 2021 · Mark scheme 22

Cambridge Computer Science (9618) mark scheme for paper 22, Oct/Nov 2021 — 9618/22/O/N/21, file 9618_w21_ms_22.pdf.

Advertisement
Loading the paper…
Text of this paper

Cambridge International AS & A Level
COMPUTER SCIENCE

9618/22

Paper 2 Problem Solving & Programming

October/November 2021

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 2021 series for most
Cambridge IGCSE™, Cambridge International A and AS Level components and some Cambridge O Level
components.

This document consists of 10 printed pages.
© UCLES 2021

[Turn over

9618/22

Cambridge International AS & A Level – Mark Scheme
PUBLISHED

October/November
2021

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 2021

Page 2 of 10

9618/22

Cambridge International AS & A Level – Mark Scheme
PUBLISHED

Question
1(a)

October/November
2021

Answer

Marks
2

The process involves:
1
2
3

Breaking down a problem / task into sub problems / steps / smaller parts
In order to explain / understand // easier to solve the problem
Leading to the concept of program modules // assigning problem parts to
teams

Max 2
1(b)

Answer
The number of dimensions of ThisArray

1

The technical terms for minimum and
maximum values that variable n may take

Lower bound, upper bound

The technical term for the variable n in the
pseudocode expression.

Index / Subscript

3

One mark per row
1(c)

Expression

Evaluates to

ASC('C')

67

2 * STR_TO_NUM ("27")

54

INT(27 / 2)

13

"Sub" & MID("Abstraction" , 4 , 5)

4

"Subtract"

One mark per row
Function names must be exactly as shown
1(d)

Expression
PressureOK AND HiFlow

FALSE

PumpOn OR PressureOK

TRUE

NOT PumpOn OR (PressureOK AND NOT HiFlow)

TRUE

NOT (PumpOn OR PressureOK) AND NOT HiFlow

FALSE

1 mark for any two rows correct
2 marks for all rows correct.

© UCLES 2021

Evaluates to

Page 3 of 10

2

9618/22

Cambridge International AS & A Level – Mark Scheme
PUBLISHED

Question

October/November
2021

Answer

2(a)

5

One mark for each outlined group.
Note:
• Sum and increment steps (bottom-right rectangles) may be in reverse
order in which case sum group will have two output lines
•

© UCLES 2021

Marks

Max 4 for non-working solution

Page 4 of 10

9618/22

Cambridge International AS & A Level – Mark Scheme
PUBLISHED

Question
2(b)(i)

October/November
2021

Answer

Marks
2

One mark for each:
Life cycle method: Iterative // Rapid Application Development (RAD)
Reason: Provides a working model / prototype at an early stage for the
principal to approve / review

2(b)(ii)

Decisions will be made regarding:

3

•
•
•

Data structures
Algorithms / flowcharts / pseudocode
Program structure (modules) / use of library routines / module - team
allocation
• User interface // Web-page layout / content (for given scenario)
• Testing method / plan
• Choice of programming language / program environment
Max 3

Question
3(a)(i)

Answer

Marks
3

Pseudocode:
TYPE Student
DECLARE StudentID : STRING
DECLARE Email : STRING
DECLARE Club_1 : INTEGER
DECLARE Club_2 : INTEGER
DECLARE Club_3 : INTEGER
ENDTYPE
Mark as follows:
•
•
•

3(a)(ii)

One mark for TYPE and ENDTYPE
One mark for StudentID and Email fields as STRING
One mark for all Club fields as INTEGER

DECLARE Membership : ARRAY [1:3000] OF Student

2

One mark per underlined phrase
3(a)(iii)

One mark for any one of:
•
•
•

3(a)(iv)

© UCLES 2021

1

Assign a value (of the corrrect data type) outside the normal range to one
of the fields
Assign an empty string to the StudentID field / Email field
or value out of range to any club field

A number outside the range 1 to 99

Page 5 of 10

1

9618/22

Cambridge International AS & A Level – Mark Scheme
PUBLISHED

Question
3(b)

October/November
2021

Answer

Marks
7

PROCEDURE GetIDs()
DECLARE Index : INTEGER
DECLARE ThisClub, Count : INTEGER
OUTPUT "Please Input Club Number: "
INPUT ThisClub
Count ← 0
FOR Index ← 1 TO 3000
IF Membership[Index].Club_1 = ThisClub OR __
Membership[Index].Club_2 = ThisClub OR __
Membership[Index].Club_3 = ThisClub THEN
Count ← Count + 1
OUTPUT Membership[Index].StudentID
ENDIF
NEXT Index
OUTPUT "There are ", Count, " Students in the club"
ENDPROCEDURE
Mark as follows:
1
2
3
4
5
6
7

Declare and initialise Count
Prompt and Input club number before the loop
Loop through 3000 elements
Compare one club field with number input
Compare all Club fields with number input
If number found, OUTPUT of StudentID field and increment Count
Final OUTPUT of Count outside the loop

Note:
Max 6 if procedure heading and ending missing or incorrect (but allow array
as parameter)

Question

Answer

4(a)

Answer
A line number containing a variable being incremented
The type of loop structure

© UCLES 2021

Marks

19 / 21 / 23
pre-condition

The number of functions used

3

The number of parameters passed to function
STR_TO_NUM()

1

The name of a procedure other than Check()

Result

Page 6 of 10

5

9618/22

Cambridge International AS & A Level – Mark Scheme
PUBLISHED

Question
4(b)

Answer
One mark per point:
•
•
•

4(c)(i)

October/November
2021
Marks
3

Meaningful variable names
Indentation / white space / blank lines
Capitalisation of keywords

One mark per point:

2

Structure: A count-controlled loop
Justification: The number of iterations is known // repeats for the length of
InString
4(c)(ii)

15, 23

1

One mark for both line numbers

© UCLES 2021

Page 7 of 10

9618/22

Cambridge International AS & A Level – Mark Scheme
PUBLISHED

Question
5(a)

October/November
2021

Answer
PROCEDURE MakeNewFile(OldFile, NewFile, Status : STRING)
DECLARE Line1, Line2, Line3 : STRING
DECLARE NumCopied, NumRecs : INTEGER

Marks
7

NumRecs ← 0
NumCopied ← 0
OPENFILE OldFile FOR READ
OPENFILE NewFile FOR WRITE
WHILE NOT EOF(OldFile)
READFILE OldFile, Line1
READFILE OldFile, Line2
READFILE OldFile, Line3
NumRecs ← NumRecs + 1
IF Line3 <> Status THEN
WRITEFILE NewFile, Line1
WRITEFILE NewFile, Line2
WRITEFILE NewFile, Line3
NumCopied ← NumCopied + 1
ENDIF
ENDWHILE
OUTPUT "File " , OldFile , " contained " , NumRecs ,__
" employee details"
OUTPUT Numcopied , " employee sets of details were __
written to file", NewFile
CLOSEFILE OldFile
CLOSEFILE NewFile
ENDPROCEDURE
Mark as follows:
1
2
3
4
5
6
7

Procedure heading and ending, including parameters
OPEN OldFile for READ and NewFile for WRITE and subsequently
CLOSE both files
Conditional loop until EOF(OldFile)
Read three lines from OldFile in a loop
Compare 3rd line read with Status parameter and if not equal write
3 lines to NewFile in a loop
Count number of sets read and those written in a loop
Final output including both counts and file names with suitable text after a
loop

Note:
MP6: Both counts must have been declared and initialised
5(b)(i)

© UCLES 2021

Store all three items on one line

1

Page 8 of 10

9618/22

Cambridge International AS & A Level – Mark Scheme
PUBLISHED

Question
5(b)(ii)

October/November
2021

Answer

Marks
2

One mark per point:
Advantage: Fewer file operations required
Disadvantage: Algorithm to combine / extract individual data items is more
complex

Question
6(a)

Answer
FUNCTION FirstRowSet() RETURNS INTEGER
DECLARE Row, Col : INTEGER
DECLARE Found : BOOLEAN

Marks
7

// array is 1280 × 800
Row ← 1
Found ← FALSE
WHILE Row <= 800 AND Found = FALSE // top to bottom
Col ← 1
WHILE Col <= 1280 AND Found = FALSE // left to right
IF Screen[Row,Col] = 1 THEN
Found ← TRUE // end function as soon as first
// found
ENDIF
Col ← Col + 1
ENDWHILE
Row ← Row + 1
ENDWHILE
IF Found = FALSE THEN
Row ← 0
ENDIF
RETURN Row - 1
ENDFUNCTION

// nothing found

Mark as follows:
1
2
3
4
5
6
7
6(b)

One mark for:
•
•

© UCLES 2021

Function heading and ending and return type
(Conditional) outer loop 1 to 800 (row)
(Conditional) inner loop 1 to 1280 // 1280 to 1 (column)
Reference Screen element and test for = 1 // <> 0
and if true save row number and exit loops
Increment index variables in both inner and outer loop
Return Row number or −1, following a reasonable attempt
2

(A flag is used to) exit the loops // iteration is terminated
as soon as a Screen element with value 1 is found

Page 9 of 10

9618/22

Cambridge International AS & A Level – Mark Scheme
PUBLISHED

Question
6(c)(i)

October/November
2021

Answer
One mark for:
• Parameter(s) need to be passed to the module to identify the type of
search
• Search algorithm is controlled by (global) variables / parameters

Marks
2

Alternative:
• The search algorithms from the original modules are included in the new
module
• The new module needs to return / store the four values (the results of the
four searches)
6(c)(ii)

One mark for advantage and one for disadvantage:
Advantage: (max 1)
• Only have to change one module if specification changes
• Less repetitive code / fewer lines of code
• Aids re-usability

2

Disadvantage: (max 1)
• Single module more complex / more error prone / more difficult to
debug ...
• Single module cannot be split among programmers / teams
Max 2
6(d)

PROCEDURE GetCentre ()
DECLARE StartRow, EndRow, StartCol, EndCol : INTEGER
StartRow ← FirstRowSet()
IF StartRow = -1 THEN
CentreRow ← -1 // no 'touch' detected
ELSE
EndRow ← LastRowSet()
StartCol ← FirstColSet()
EndCol ← LastColSet()
CentreRow ← INT((StartRow + EndRow)/2)
CentreCol ← INT((StartCol + EndCol)/2)
ENDIF
ENDPROCEDURE
Mark as follows:
1
2
3
4
5
6

Call <any Set function> and check for -1 // check for no element set
...and if so set CentreRow to –1
Call all 4 Set functions to get 'extremity' values
Calculate centre row and centre column
Use of INT() function or DIV operator on values from MP4
Assign calculated values to CentreRow and CentreCol

Note:
Max 5 if procedure heading and ending missing or incorrect (ignore array if
passed as a parameter) or any local variables are undefined or of incorrect
type
© UCLES 2021

Page 10 of 10

6

Advertisement