Professional Documents
Culture Documents
(MS) Yearly 9618 P2
(MS) Yearly 9618 P2
(MS) Yearly 9618 P2
YEARLY
PAST PAPER
9618
PAPER 2
MARKING
SCHEME
Cambridge International AS & A Level
SHAHARYAR LALANI
COMPUTER SCIENCE 9618/02
Paper 2 For examination from 2021
MARK SCHEME
Maximum Mark: 75
Specimen
These general marking principles must be applied by all examiners when marking candidate answers. They should be applied alongside the specific
9618/02
content of the mark scheme or generic level descriptors for a question. Each question paper and mark scheme will also comply with these marking
© UCLES 2018
principles.
• 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:
Page 2 of 12
SPECIMEN
• 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.
Cambridge International AS & A Level – Mark Scheme
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).
For examination
from 2021
SHAHARYAR LALANI
GENERIC MARKING PRINCIPLE 6:
9618/02
Marks awarded are based solely on the requirements as defined in the mark scheme. Marks should not be awarded with grade thresholds or grade
© UCLES 2018
descriptors in mind.
Page 3 of 12
SPECIMEN
Cambridge International AS & A Level – Mark Scheme
For examination
from 2021
SHAHARYAR LALANI
Question Answer Marks
1(a)(i) 5
9618/02
© UCLES 2018
Today STRING
WeekNumber INTEGER
Revision CHAR
MaxWeight REAL
LastBatch BOOLEAN
Page 4 of 12
SPECIMEN
MOD(WeekNumber, 12) 1
(Revision <= 'D') AND (NOT LastBatch) FALSE
SHAHARYAR LALANI
Question Answer Marks
1(c) MyCount ← 101 4
9618/02
© UCLES 2018
REPEAT
OUTPUT MyCount
MyCount ← MyCount + 2
Page 5 of 12
SPECIMEN
Max 3
2(b) FUNCTION CardPayment(Amount : REAL, Name : STRING) RETURNS BOOLEAN 3
Cambridge International AS & A Level – Mark Scheme
Function name and parameter names not important but must be present.
For examination
from 2021
SHAHARYAR LALANI
Question Answer Marks
3(a) POP(): 4
9618/02
• The value ‘E’ is removed from the stack (and assigned to variable MyVar)
© UCLES 2018
• Top of Stack pointer is incremented to 102
PUSH():
• Top of Stack pointer is decremented to 101
• ‘Z’ is loaded into address 101
Page 6 of 12
• Original variable is changed when parameter changed in called module.
SPECIMEN
Mark as follows:
• One mark for each name and corresponding value
• One mark per bullet in explanation
Cambridge International AS & A Level – Mark Scheme
SHAHARYAR LALANI
Question Answer Marks
5(a) Pseudocode: 3
9618/02
© UCLES 2018
TYPE StockItem
DECLARE ProductCode : STRING
DECLARE Price : REAL
DECLARE NumberInStock : INTEGER
ENDTYPE
(allow END)
Mark as follows:
• One mark for TYPE and ENDTYPE
• One mark for Productcode
• One mark for Price and NumberInStock
5(b) DECLARE Stock : ARRAY [1:1000] OF StockItem 3
Page 7 of 12
SPECIMEN
SHAHARYAR LALANI
Question Answer Marks
5(d) Pseudocode: 4
9618/02
© UCLES 2018
DECLARE n : INTEGER
FOR n ← 1 to 1000
IF Stock[n].Price >= 100
THEN
OUTPUT "ProductCode: " & Stock[n].ProductCode &
" Number in Stock: " & Stock[n].NumberInStock
ENDIF
NEXT
Page 8 of 12
SPECIMEN
Cambridge International AS & A Level – Mark Scheme
For examination
from 2021
SHAHARYAR LALANI
Question Answer Marks
6(a) Pseudocode solution: 9
9618/02
© UCLES 2018
FUNCTION ValidatePassword(Pass : STRING) RETURNS BOOLEAN
DECLARE LCaseChar, UCaseChar, NumChar, n : INTEGER
DECLARE NextChar : CHAR
DECLARE ReturnFlag : BOOLEAN
ReturnFlag ← TRUE
LCaseChar ← 0
UCaseChar ← 0
NumChar ← 0
n ← 1
Page 9 of 12
SPECIMEN
SHAHARYAR LALANI
Question Answer Marks
6(a) IF LCaseChar > 1 AND UCaseChar > 1 AND NumChar > 2 AND ReturnFlag
9618/02
THEN
© UCLES 2018
ReturnFlag ← TRUE
ELSE
ReturnFlag ← FALSE
ENDIF
RETURN ReturnFlag
ENDFUNCTION
Page 10 of 12
SPECIMEN
e.g. ‘ABcd123’
For examination
from 2021
SHAHARYAR LALANI
Question Answer Marks
6(b)(ii) Modify Password1 for each rule: 4
9618/02
© UCLES 2018
Test string:
• Invalid passwords
– Lower case characters (e.g. ‘ABc123’)
– Upper case characters (e.g. ‘Acd123’)
– Numeric characters (e.g. ‘ABcd12’)
• Containing an invalid character (e.g. ‘ABcd12+3’)
Mark as follows:
One mark for correct invalid string + reason (testing different rules of the function); no half marks
Each test string must only break a single rule
6(b)(iii) White-box 1
6(b)(iv) One mark per bullet: 2
• Testing may be carried out before the modules are developed // not ready for full testing
• Module stubs contain simple code to provide a known response // temporary replacement for a called module/return a
fixed value/output a message to confirm the module has been called
Page 11 of 12
SPECIMEN
Cambridge International AS & A Level – Mark Scheme
For examination
from 2021
SHAHARYAR LALANI
Question Answer Marks
7 Pseudocode : 8
9618/02
© UCLES 2018
PROCEDURE LogEvents()
CLOSEFILE "LoginFile.txt"
ENDPROCEDURE
Page 12 of 12
SPECIMEN
Allow single write to file outside loop if complete string built within loop
For examination
from 2021
SHAHARYAR LALANI
Cambridge International AS & A Level
SHAHARYAR LALANI
COMPUTER SCIENCE 9618/21
Paper 2 Problem Solving & Programming Skills May/June 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 May/June 2021 series for most Cambridge
IGCSE™, Cambridge International A and AS Level components and some Cambridge O Level components.
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
SHAHARYAR LALANI
for a question. Each question paper and mark scheme will also comply with these marking principles.
• 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.
Marks awarded are always whole marks (not half marks, or other fractions).
• 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.
Rules must be applied consistently, e.g. in situations where candidates have not followed
instructions or in the application of generic level descriptors.
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).
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.
1(a) 4
Example
SHAHARYAR LALANI
Explanation Variable name Data type
value
One mark for each appropriate variable name plus data type
1(b) 5
Statement Error
Should be arithmetic
Result ← 2 & 4 operator (not &) // 2 and 4
should be CHAR / STRING
1(c) Structure: 3
SHAHARYAR LALANI
• Record
Justification:
• Allows different data types
• to be stored under one identifier
Mark as follows:
One mark for Structure
Two marks for justification.
Alternative
• Two (1D) arrays
• One of string, one of integer
• Where same index links the name with the score
2(a) 5
SHAHARYAR LALANI
One mark for:
SHAHARYAR LALANI
SHAHARYAR LALANI
1 Initialise MAX to first value input
2 Set Total to zero
3 Input 49 more values (or 50 values in total)
4 Sum all values input
5 Set new MAX when Input value > MAX in a loop
6 Sum all but largest (or subtract MAX from total), calculate and output
average
• Data from the arrays is written to the files at the end of the day / before the
program is terminated / computer is switched off
• Data can then be read from the files at the start of the next day and written to
/ stored in the arrays
• No need to (re-)enter the data manually // only need to enter data once
3(a)(ii) • The data is retained when the program is terminated / after the computer is 1
switched off // data is stored permanently // non-volatile storage
• Data items are combined to form a single string / saved as a single line in the
file
• Data items are separated by a special character // make each data item a
fixed length
ALTERNATIVE:
SHAHARYAR LALANI
DECLARE LineNum : INTEGER
DECLARE ThisLine : STRING
Marks as follows:
4(a) 5
Name Flag Index NewName ThisChar
SHAHARYAR LALANI
"∇in∇a∇∇Cup"
TRUE 1 ""
'∇'
"∇"
2 'i'
FALSE "∇I"
3 'n'
"∇In"
4 '∇'
TRUE "∇In∇"
5 'a'
FALSE "∇In∇A"
6 '∇'
TRUE "∇In∇A∇"
7 '∇'
"∇In∇A∇∇"
8 'C'
FALSE "∇In∇A∇∇C"
9 'u'
"∇In∇A∇∇Cu"
10 'p'
"∇In∇A∇∇Cup"
Mark as follows:
• One mark for each of columns 2 to 5 (condone missing final 11)
• One mark for final row all correct (including final 11)
SHAHARYAR LALANI
Justification: The number of iterations is known
ALTERNATIVE:
Line number: 26
5 PROCEDURE Sort() 8
SHAHARYAR LALANI
DECLARE Temp : INTEGER
DECLARE NoSwaps : BOOLEAN
DECLARE Boundary, Row, Col : INTEGER
Boundary ← 999
REPEAT
NoSwaps ← TRUE
FOR Row ← 1 TO Boundary
IF Result[Row, 2] > Result[Row + 1, 2] THEN
FOR Col ← 1 TO 2
Temp ← Result [Row, Col]
Result [Row, Col] ← Result [Row + 1, Col]
Result [Row + 1, Col] ← Temp
NEXT Col
NoSwaps ← FALSE
ENDIF
NEXT J
Boundary ← Boundary - 1
UNTIL NoSwaps = TRUE
ENDPROCEDURE
Mark as follows:
1 Outer loop
2 Inner loop
3 Correct comparison in a loop
4 Correct swap of col1 array elements in a loop
5 Correct swap of col2 array elements in a loop (via loop or separate
statements)
6 'NoSwap' mechanism: Conditional outer loop including flag reset
7 'NoSwap' mechanism: Set flag in inner loop to indicate swap
8 Reducing Boundary in the outer loop
SHAHARYAR LALANI
• An array (1D) to store the data and a second array (1D) to store the pointers
• An (integer) variable to hold the start pointer and an (integer) variable to store
the next free pointer
ALTERNATIVE:
• Define a record type comprising a data element and a pointer and declare an
array (1D) of this type
• An integer variable to hold the start pointer and an integer variable to store
the next free pointer
SHAHARYAR LALANI
DECLARE Index, ThisPos, NumFound : INTEGER
DECLARE ThisChar : Char
Index ← -1
Numfound ← 0
ThisPos ← 1
ENDFUNCTION
7(b) Marks awarded for any reference to each of the following steps of the algorithm: 4
SHAHARYAR LALANI
1 Mention of variable for use as array index
2 Use of a loop (to check through the array)
3 If word is the same as the current array element then return FALSE /
set flag
4 If word not already in array, loop to find unused element (second loop)
5 Store word in unused element and return TRUE, otherwise return
FALSE
VARIATION:
SHAHARYAR LALANI
DECLARE NextWord : STRING
DECLARE Done : BOOLEAN
DECLARE ThisChar : CHAR
DECLARE Index : INTEGER
NextWord ← ""
Done ← FALSE
REPEAT
ThisChar ← MID(FNString, Index, 1)
IF ThisChar <> SPACECHAR THEN
NextWord ← NextWord & ThisChar // build up NextWord
ENDIF
IF ThisChar = SPACECHAR OR Index = LENGTH(FNString) THEN
Done ← TRUE
ENDIF
Index ← Index + 1
RETURN NextWord
ENDFUNCTION
1 Conditional loop
2 Extract char from FNString and compare with SPACECHAR in a
loop
3 Concatenate with NextWord if not SPACECHAR in a loop
4 Exit loop when SPACECHAR encountered or when end of FNString
reached
5 Return NextWord (after reasonable attempt at forming, and must have
been initialised)
SHAHARYAR LALANI
FUNCTION GetWord (Index : INTEGER) RETURNS STRING
DECLARE Done : BOOLEAN
DECLARE ThisChar : CHAR
DECLARE Index, NextPos : INTEGER
Done ← FALSE
NextPos ← Index // must be at least one character in
// the required word
REPEAT
ThisChar ← MID(FNString, NextPos, 1)
IF ThisChar = SPACECHAR OR NextPos =
LENGTH(FNString) THEN
Done ← TRUE
ELSE
NextPos ← NextPos + 1
ENDIF
UNTIL Done = TRUE
ENDFUNCTION
1 Conditional loop
2 ...extract char from FNString and compare with SPACECHAR in a
loop
3 .. increment count if word continues
4 Exit loop when SPACECHAR encountered or when end of FNString
reached
5 Apply substring function and Return
SHAHARYAR LALANI
COMPUTER SCIENCE 9618/22
Paper 2 Problem Solving & Programming Skills May/June 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 May/June 2021 series for most Cambridge
IGCSE™, Cambridge International A and AS Level components and some Cambridge O Level components.
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
SHAHARYAR LALANI
for a question. Each question paper and mark scheme will also comply with these marking principles.
• 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.
Marks awarded are always whole marks (not half marks, or other fractions).
• 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.
Rules must be applied consistently, e.g. in situations where candidates have not followed
instructions or in the application of generic level descriptors.
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).
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.
1(a)(i) 4
Variable Example data value Data type
SHAHARYAR LALANI
Name "Catherine" STRING
1(a)(ii) 4
Expression Evaluates to
MID(Name, 1, 3) "Cat"
1(b) 3
Statement Selection Assignment Iteration
Index ← Index + 1
ENDWHILE
2(a)(i) 4
The number of transitions that result in a different state 3
SHAHARYAR LALANI
Current state: S2
• User ID / Username
• Book ID
• Date of loan / return date
2(b)(ii) Many examples but must be data that is NOT required for a loan, but which 1
COULD be required somewhere by the library system.
Answers include:
• Users name / address / phone number / DOB
• Book title / author / publisher / library rack number / ISBN number /
price
• Date of loan / return date (if not already given in part (i))
• The length of the loan (assumed to be the same for all books)
3(d) 2
SHAHARYAR LALANI
One mark for:
SHAHARYAR LALANI
DECLARE Index, Count : INTEGER
Count ← 0
FOR Index ← 1 TO 100
RNum[Index] ← INT(RAND(200)) + 1
IF RNum[Index] >= 66 AND RNum[Index] <= 173 THEN
Count ← Count + 1
ENDIF
NEXT Index
OUTPUT Count
Mark as follows:
1 Array declaration
2 Loop for 100 iterations
3 Array element index 'syntax' (left-hand side of assignment
expression) in a loop
4 Use of RAND() to generate value in range (and assign to array
element) in a loop
5 Check if random number within range and if so, increment count in
a loop
6 Output of count (following a reasonable attempt) after the loop
5(b)(i) 4
Answer
SHAHARYAR LALANI
DECLARE Index : INTEGER
DECLARE ThisChar : CHAR
FOR Index ← 1 to 6
CharCount[Index] ← 0 //initialise elements
NEXT Index
Index ← 1
CASE OF ThisChar
'a' : CharCount[1] ← CharCount[1] + 1
'e' : CharCount[2] ← CharCount[2] + 1
'i' : CharCount[3] ← CharCount[3] + 1
'o' : CharCount[4] ← CharCount[4] + 1
'u' : CharCount[5] ← CharCount[5] + 1
'a' TO 'z': CharCount[6] ← CharCount[6] + 1
ENDCASE
NEXT Index
FOR Index ← 1 to 6
OUTPUT CharCount[Index] //output results
NEXT Index
ENDPROCEDURE
SHAHARYAR LALANI
• At least one leading space (before the first word)
• at least one trailing space (after the last word)
• at least one instance of multiple spaces between words
• At least one upper case character
Mark as follows:
One mark for one correct
Two marks for three correct
Three marks for all correct
SHAHARYAR LALANI
DECLARE Found : BOOLEAN
DECLARE Index : INTEGER
Found ← False
Index ← 1
ThisWord ← TO_LOWER(ThisWord)
REPEAT
IF TO_LOWER(IgnoreList[Index]) = ThisWord THEN
Found ← TRUE
ENDIF
Index ← Index + 1
UNTIL Found = TRUE OR Index > 10
RETURN Found
ENDFUNCTION
SHAHARYAR LALANI
DECLARE NewString, NextWord : STRING
DECLARE ThisWordNum, Index : INTEGER
ThisWordNum ← 0
NewString ← ""
REPEAT
ThisWordNum ← ThisWordNum + 1
Index ← GetStart(ThisWordNum)
IF Index <> -1 THEN //if there is ThisWordNum
NextWord ← GetWord(Index)
IF IgnoreWord(NextWord) = FALSE THEN
NewString ← NewString & UCASE(LEFT(NextWord, 1))
ENDIF
ENDIF
UNTIL Index = -1
OUTPUT NewString
ENDPROCEDURE
SHAHARYAR LALANI
COMPUTER SCIENCE 9618/21
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.
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
SHAHARYAR LALANI
for a question. Each question paper and mark scheme will also comply with these marking principles.
• 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.
Marks awarded are always whole marks (not half marks, or other fractions).
• 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.
Rules must be applied consistently, e.g. in situations where candidates have not followed
instructions or in the application of generic level descriptors.
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).
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.
SHAHARYAR LALANI
• The program obeys the rules / grammar of the programming language
used
• The program will run // it can be compiled / interpreted
• Accept by example. e.g. 'no mis-spelt keywords' / 'all brackets match'
1(a)(ii) One mark for type plus one for corresponding description 2
Description:
• An error in the algorithm / design of the solution
• the program does not behave as expected / give the expected output.
• Accept by example e.g. wrong arithmetic operator used / wrong loop
count
OR
Description:
• The program performs an illegal instruction / invalid operation
• Accept by example: divide by zero or endless loop or simply 'crashes' /
freezes
1(b) 4
Use of variable Data type
1(c)(i) 3
Information Essential Not essential
SHAHARYAR LALANI
Departure time
Flight Number
Departure airport
Aircraft type
Ticket price
1(c)(ii) One mark for technique and one for benefit, Max 1 mark for 'Benefit' 2
Technique: Abstraction
Benefit:
• The solution is simplified so easier / quicker to design / implement
• The system is tailored to the need of the user
Max 2 marks
Max 6 marks
2(b) Count ← 1 6
SHAHARYAR LALANI
Flag ← FALSE
WHILE Flag = FALSE AND Count <= 5
CALL ReBoot()
Count ← Count + 1
Flag ← Check()
ENDWHILE
1 Cat
2 Fish
3(b)(i) One mark for data values plus one mark for pointers 3
SHAHARYAR LALANI
0 Frog
1 Cat
3 Elk
4 Wasp
5 Bee
3(b)(ii) 2
0 Shark ← End of queue pointer
1 (Cat)
2 (Fish)
3 (Elk)
5 Bee
6 Mouse
7 Dolphin
4(a) 4
Test Test data value Explanation Expected Outcome
SHAHARYAR LALANI
1 23 Normal Data Data is accepted
4(b) 3
5(a) One mark for the character and one for the corresponding reason. 2
5(b) Design 1
SHAHARYAR LALANI
DECLARE FileData : STRING
DECLARE Index, Count : INTEGER
Count ← 0
OPENFILE LogFile FOR APPEND
FOR Index ← 1 TO 2000
FileData ← LogArray[Index]
CLOSEFILE LogFile
RETURN Count
ENDFUNCTION
SHAHARYAR LALANI
DECLARE Col : INTEGER
ENDPROCEDURE
ALTERNATIVE 1:
ALTERNATIVE 2:
Mark as follows:
SHAHARYAR LALANI
INTEGER
DECLARE ThisCol, Step : INTEGER
DECLARE Found: BOOLEAN
Found ← FALSE
ThisCol ← StartCol
RETURN ThisCol
ENDFUNCTION
Mark as follows:
Max 7 marks if function heading, including return type, and ending is incorrect
or incomplete
SHAHARYAR LALANI
DECLARE StartCol, EndCol, CentreCol : INTEGER
StartCol ← SearchInRow(ThisRow, 1)
IF StartCol = -1 THEN
CentreCol ← StartCol
ELSE
EndCol ← SearchInRow(ThisRow, 1280)
CentreCol ← INT((StartCol + EndCol)/2)
ENDIF
RETURN CentreCol
ENDFUNCTION
Mark as follows:
Max 5 marks if function heading, including return type, and ending is incorrect
or incomplete
SHAHARYAR LALANI
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.
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
SHAHARYAR LALANI
for a question. Each question paper and mark scheme will also comply with these marking principles.
• 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.
Marks awarded are always whole marks (not half marks, or other fractions).
• 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.
Rules must be applied consistently, e.g. in situations where candidates have not followed
instructions or in the application of generic level descriptors.
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).
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.
SHAHARYAR LALANI
1 Breaking down a problem / task into sub problems / steps / smaller parts
2 In order to explain / understand // easier to solve the problem
3 Leading to the concept of program modules // assigning problem parts to
teams
Max 2
1(b) 3
Answer
The technical terms for minimum and Lower bound, upper bound
maximum values that variable n may take
1(c) 4
Expression Evaluates to
ASC('C') 67
2 * STR_TO_NUM ("27") 54
INT(27 / 2) 13
1(d) 2
Expression Evaluates to
2(a) 5
SHAHARYAR LALANI
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
SHAHARYAR LALANI
Life cycle method: Iterative // Rapid Application Development (RAD)
• 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
3(a)(i) Pseudocode: 3
TYPE Student
DECLARE StudentID : STRING
DECLARE Email : STRING
DECLARE Club_1 : INTEGER
DECLARE Club_2 : INTEGER
DECLARE Club_3 : INTEGER
ENDTYPE
Mark as follows:
• 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
SHAHARYAR LALANI
DECLARE Index : INTEGER
DECLARE ThisClub, Count : INTEGER
Count ← 0
NEXT Index
Mark as follows:
Note:
Max 6 if procedure heading and ending missing or incorrect (but allow array
as parameter)
4(a) 5
Answer
A line number containing a variable being incremented 19 / 21 / 23
SHAHARYAR LALANI
• Meaningful variable names
• Indentation / white space / blank lines
• Capitalisation of keywords
4(c)(ii) 15, 23 1
SHAHARYAR LALANI
DECLARE Line1, Line2, Line3 : STRING
DECLARE NumCopied, NumRecs : INTEGER
NumRecs ← 0
NumCopied ← 0
Mark as follows:
Note:
MP6: Both counts must have been declared and initialised
SHAHARYAR LALANI
Advantage: Fewer file operations required
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
Mark as follows:
SHAHARYAR LALANI
• Parameter(s) need to be passed to the module to identify the type of
search
• Search algorithm is controlled by (global) variables / parameters
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)
Disadvantage: (max 1)
• Single module more complex / more error prone / more difficult to
debug ...
• Single module cannot be split among programmers / teams
Max 2
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 Call <any Set function> and check for -1 // check for no element set
2 ...and if so set CentreRow to –1
3 Call all 4 Set functions to get 'extremity' values
4 Calculate centre row and centre column
5 Use of INT() function or DIV operator on values from MP4
6 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
SHAHARYAR LALANI
COMPUTER SCIENCE 9618/21
Paper 21 Fundamental Problem Solving & Programming Skills May/June 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 May/June 2022 series for most
Cambridge IGCSE, Cambridge International A and AS Level and Cambridge Pre-U components, and some
Cambridge O Level components.
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
SHAHARYAR LALANI
for a question. Each question paper and mark scheme will also comply with these marking principles.
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.
Marks awarded are always whole marks (not half marks, or other fractions).
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.
Rules must be applied consistently, e.g. in situations where candidates have not followed
instructions or in the application of generic level descriptors.
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).
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.
1(a) An algorithm 1
SHAHARYAR LALANI
1(b)(i) 4
Variable Use of variable Data type
1(b)(ii) One mark for variable name, and one for reason 2
Variable: Temp
Reason: Name does not indicate what the variable is used for
1(c) 4
Expression Evaluation
INT((31 / 3) + 1) 11
MID(TO_UPPER("Version"), 4, 2) "SI"
SHAHARYAR LALANI
Example answer
3(a) One mark per description of appropriate sub-problem for given scenario. 3
Examples include:
Allows the user to search for films being shown // input name of film they
want to see
3(b) Function 1
The value that has been on the stack for the longest time. 'H'
4(b) 4
Stack Pointer
SHAHARYAR LALANI
Memory
Value
location
200
202 'C'
203 'A'
204 'X'
205 'Z'
206 'N'
207 'P'
SHAHARYAR LALANI
DECLARE ThisInt, Count : INTEGER
Count 0
OUTPUT Count
Mark as follows:
Alternative Solution:
OUTPUT Count
Mark as follows:
SHAHARYAR LALANI
ThisChar 'a'
ELSE
IF MySwitch = 2 THEN
ThisChar 'y'
ELSE
IF MySwitch = 3 THEN
ThisChar '7'
ELSE
ThisChar '*'
ENDIF
ENDIF
ENDIF
Mark as follows:
SHAHARYAR LALANI
DECLARE IsPal : BOOLEAN
DECLARE Index, Num : INTEGER
DECLARE CharA, CharB : CHAR
IsPal TRUE
Index 1
Num INT(LENGTH(InString) / 2)
ENDFUNCTION
Mark as follows:
7(b) 4
Label Text
SHAHARYAR LALANI
A Set OutString to ""
F YES
G NO
SHAHARYAR LALANI
DECLARE ThisRange : INTEGER
DECLARE ThisChar : CHAR
CASE OF ThisRange
1: ThisChar CHR(INT(RAND(26) + 65)) // 65 to 90:
'A' to 'Z'
ThisChar LCASE(ThisChar) // 'a' to 'z'
2: ThisChar CHR(INT(RAND(26) + 65)) // 65 to 90:
A to Z
3: ThisChar NUM_TO_STR(INT(RAND(10)) // '0' to '9'
ENDCASE
RETURN ThisChar
ENDFUNCTION
Mark as follows:
SHAHARYAR LALANI
DECLARE Index : INTEGER
DECLARE Password : STRING
Password ""
Index 1
RETURN Password
ENDFUNCTION
Mark as follows:
8(c) One mark for the name, one for the description 3
Name:
Stub testing
Description:
A simple module is written to replace each of the modules.
The simple module will return an expected value // will output a message
to show they have been called
One mark for each password example that breaks one of the rules due to:
Length too long // length too short
Invalid character
Incorrect grouping (including number of hyphens)
Duplicated characters
SHAHARYAR LALANI
Generate a random integer divisible by 3
Split range into 1/3 and set as numeric
Else alphabetic character
SHAHARYAR LALANI
SUBJECT 9618/22
Paper 22 Fundamental Problem Solving & Programming Skills May/June 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 May/June 2022 series for most
Cambridge IGCSE, Cambridge International A and AS Level and Cambridge Pre-U components, and some
Cambridge O Level components.
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
SHAHARYAR LALANI
for a question. Each question paper and mark scheme will also comply with these marking principles.
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.
Marks awarded are always whole marks (not half marks, or other fractions).
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.
Rules must be applied consistently, e.g. in situations where candidates have not followed
instructions or in the application of generic level descriptors.
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).
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.
SHAHARYAR LALANI
Breakpoint
A description of what the identifier is used for / the purpose of the identifier
The data type of the identifier
The number of elements of an array // the length of a string
An example data value
Value of any constants used
The scope of the variable (local or global)
Statement Error
2 4
SHAHARYAR LALANI
3(a)(ii) 3
Label Module name
A Head
B Mod_W
C Mod_X
D Mod_V
E Mod-Z
F Mod_Y
Marks as follows:
Two rows correct – one mark
Four rows correct – two marks
All rows correct – three marks
SHAHARYAR LALANI
DECLARE ThisLine, LineX, LineY, LineZ : STRING
LineY ""
LineZ ""
CLOSEFILE ThisFile
OUTPUT LineX
OUTPUT LineY
OUTPUT LineZ
ENDPROCEDURE
SHAHARYAR LALANI
PROCEDURE LastLines(ThisFile : STRING)
DECLARE ThisLine, LineX, LineY, LineZ : STRING
DECLARE Count, Count2 : INTEGER
Count 0
OPENFILE ThisFile FOR READ
CLOSEFILE ThisFile
OPENFILE ThisFile FOR READ
OUTPUT LineX
OUTPUT LineY
OUTPUT LineZ
CLOSEFILE ThisFile
ENDPROCEDURE
7 OUTPUT the last three lines in correct sequence, following reasonable attempt
SHAHARYAR LALANI
1 Change the procedure header to include a (numeric) parameter (as well as the
filename)
2 Replace LineX, Y and Z with an array
3 Amend shuffle mechanism
4 Use new parameter to determine first line to output
5 Output the lines in a loop
5(a) One mark for type and one mark for condition: 2
SHAHARYAR LALANI
Independent marks
Type: pre-condition
Condition: when the value of ThisNum / the input value is equal to zero
5(b) 6
ThisNum ThisChar CountA CountB Flag OUTPUT
0 10 TRUE
12 '1' 1
24 '2'
57 '5' "Ignored"
43 '4' 9 FALSE
56 '5' 4
31 '3' 8
32 '3' 7
47 '4' 6 FALSE
0 4
Marks as follows:
One mark per outlined group
If no marks per group then mark by columns (columns 3 to 6) for max 4
SHAHARYAR LALANI
DECLARE Count, Total, Index : INTEGER
DECLARE Average : REAL
DECLARE NumString : STRING
DECLARE ThisChar : CHAR
Count 0
Total 0
NumString ""
ENDPROCEDURE
Marks as follows:
1 Declare and initialise Count, Total and NumString
2 Loop for number of characters in InString
3 Extract a character and test for comma in a loop
4 If comma, convert NumString to integer and update Total and Count
5 and reset NumString
6 Otherwise append character to NumString
7 Calculate average AND final output statement(s) outside the loop
SHAHARYAR LALANI
RETURNS STRING
DECLARE MidString : STRING
DECLARE InStringLen : INTEGER
InStringLen LENGTH(InString)
RETURN MidString
ENDFUNCTION
Marks as follows:
1 Function heading and ending including parameters and return type
2 Correct use of one substring functions
3 Correct use of both substring functions (in correct sequence)
4 Return substring after a reasonable attempt
Check that:
Start and/or Num are >= 1 // positive
Length of InString is "sufficient" for required operation
SHAHARYAR LALANI
RETURNS BOOLEAN
DECLARE Found : BOOLEAN
DECLARE Index : INTEGER
Found FALSE
Index 1
RETURN Found
ENDFUNCTION
SHAHARYAR LALANI
DECLARE IndexA, IndexB : INTEGER
DECLARE ThisPassword, ThisValue : STRING
DECLARE Duplicates : BOOLEAN
Duplicates FALSE
IndexA 1
ENDPROCEDURE
SHAHARYAR LALANI
1 Initialise password to empty string at the start and return (attempted) password
at the end of the function
2 Two loops to generate 3 groups of 4 characters // One loop to generate 12 / 14
characters
3 Use of RandomChar()to generate a character in a loop
4 Reject character if Exists()returns TRUE, otherwise form string in a loop
5 (Attempt to) use hyphens to link three groups
6 Three groups of four characters generated correctly with hyphens and without
duplication (completely working algorithm)
SHAHARYAR LALANI
COMPUTER SCIENCE 9618/23
Paper 23 Problem Solving & Programming May/June 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 May/June 2022 series for most
Cambridge IGCSE, Cambridge International A and AS Level and Cambridge Pre-U components, and some
Cambridge O Level components.
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
SHAHARYAR LALANI
for a question. Each question paper and mark scheme will also comply with these marking principles.
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.
Marks awarded are always whole marks (not half marks, or other fractions).
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.
Rules must be applied consistently, e.g. in situations where candidates have not followed
instructions or in the application of generic level descriptors.
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).
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.
SHAHARYAR LALANI
1(b)(i) 1 mark for any two rows correct 2
1 mark for all rows correct
2 Dependent marks 4
SHAHARYAR LALANI
One mark for type; one mark for matching reason
Answers include:
Type: Adaptive
Reason: To accommodate a change in the requirement / technology /
legislation
e.g. a new HTML version is available
Type: Corrective
Reason: The program does not operate as expected / contains a bug
e.g. passwords are not hidden
3(b) 5
SHAHARYAR LALANI
Type of Example Expected
Explanation
test data test value return value
Abnormal /
149 "FAIL" Maximum unacceptable
Boundary
Boundary /
Extreme / 150 "PASS" Minimum acceptable
Normal
Boundary /
Extreme / 155 "PASS" Maximum acceptable
Normal
Abnormal /
156 "FAIL" Minimum unacceptable
Boundary
SHAHARYAR LALANI
So that unused elements may be recognised when processing /
searching
Otherwise the element may contain old / unexpected data
SHAHARYAR LALANI
DECLARE Value : INTEGER
RETURN Value
ENDFUNCTION
Marks as follows:
SHAHARYAR LALANI
Rows A, B AND C
Each of rows D, E and F
Label Text
A Is Num > 9?
B YES
C NO
7(a)(i) The lines are output in an incorrect sequence / in the wrong order / not as 1
they appear in the file
If the final line of the file is not written into array element 3
then outputting the elements in the sequence 1 to 3 will give the error.
OR
Store the index of the last element written to buffer (the last line of the
file)
Replace the FOR loop with something that starts at index
and then wraps around (MOD 3)
SHAHARYAR LALANI
LineNum (LineNum MOD 3) + 1 // ((LineNum + 3) MOD 3)
+ 1
8(a) 3
1 (at least) three intermediate shapes with at least one valid stage names
2 Up and Down arrows between each pair of shapes
3 Design – Coding – Testing labels in correct sequence
8(b) Downward arrows: result from one stage is input / passed to the next 2
SHAHARYAR LALANI
DECLARE Password, Group : STRING
DECLARE NextChar : CHAR
DECLARE ACount, BCount : INTEGER
CONSTANT HYPHEN = '-'
Password ""
FOR ACount 1 TO 3
Group ""
FOR BCount 1 TO 4
REPEAT
NextChar RandomChar()
UNTIL Exists(Group, NextChar) = FALSE
Group Group & NextChar
NEXT BCount
Password Password & Group & HYPHEN
NEXT ACount
Password LEFT(Password, 14) // remove final hyphen
RETURN Password
ENDFUNCTION
SHAHARYAR LALANI
RETURNS BOOLEAN
DECLARE Index : INTEGER
DECLARE Added : BOOLEAN
Added FALSE
Index 1
RETURN Added
ENDFUNCTION
Marks as follows:
1 Check that the website domain name isn't already in array using
FindPassword() / linear search, otherwise:
2 (Conditional) loop while not added and not end of array
3 Check for unused element by testing value in column 1 in a loop
4 If unused, write parameter values to column 1 and 2 and set flag /
variable
5 ...having used Encrypt() on the password
6 Return BOOLEAN value (correctly in all cases)
Select a (separator) character that cannot occur in the domain name (e.g.
space)
Create a string from the domain name followed by the separator
...Concatenate the encrypted password (and write as one line of the file)
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.
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
SHAHARYAR LALANI
for a question. Each question paper and mark scheme will also comply with these marking principles.
• 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.
Marks awarded are always whole marks (not half marks, or other fractions).
• 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.
Rules must be applied consistently, e.g. in situations where candidates have not followed
instructions or in the application of generic level descriptors.
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).
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.
SHAHARYAR LALANI
1 They are tried and tested so free from errors
2 They perform a function that you may not be able to program yourself
(for example encryption)
3 They are readily available / speed up development time
Statement Error
X STR_TO_NUM("37") + 5 NO ERROR
SHAHARYAR LALANI
• Abstraction is used to filter out information / data that is not necessary
for the task
Or the opposite:
One mark for each TWO data items (not dependent on 'Explanation'):
Items include:
Examples include:
SHAHARYAR LALANI
1 Data A and K stored in new / existing nodes
2 Start pointer points to Node A
3 Node A points to Node C and Node C points to Node K
4 Node K contains Null Pointer
SHAHARYAR LALANI
1 Procedure heading and ending and declaration of both indexes
2 Loop to process all elements from Array1
3 Sum (any) three consecutive values from Array1 and divide by 3
in a loop
4 Convert result to Integer
5 Assign value to correct element of Array2 in a loop
6 Increment Array2 index in a loop
PROCEDURE Summarise()
DECLARE Value : REAL
DECLARE IxA, IxB : INTEGER // Index variables
IxB 1
ENDPROCEDURE
6(a) One mark for any part correct (accept equivalent wording) (Max 1): 1
SHAHARYAR LALANI
Index NextChar Dots Ats Others Valid
0 0 0 TRUE
1 'L' 1
2 'i' 2
3 'z' 3
4 '.' 1
5 '1' 4
6 '2' 5
7 '3' 6
8 '@' 1
9 'b' 7
10 'i' 8
11 'g' 9
12 '@' 2 FALSE
6(b)(ii) FALSE 1
SHAHARYAR LALANI
1 Declaration of local variables for Par1 Par2 and Par3
2 Loop to end of (parameter) string // until operator is found
3 Extract a character in a loop...
4 Attempt at extraction of three parts of expression using substring
functions
5 Completely correct extraction of all three parts of expression
6. Convert string to Integer using STR_TO_NUM(<something
sensible>)
7 Attempt to interpret at least two operators (Par2): + - * /
8 Corresponding correct calculation (all operators) and final Output of
result
Val1 STR_TO_NUM(Par1)
Val2 STR_TO_NUM(Par3)
CASE OF Par2
PLUS : Result Val1 + Val2
MINUS : Result Val1 - Val2
MULTIPLY : Result Val1 * Val2
DIVIDE : Result Val1 / Val2
ENDCASE
OUTPUT Result
ENDPROCEDURE
SHAHARYAR LALANI
Reason: The result is infinity / cannot be represented / is undefined // will
cause the program to crash
Count 0
Valid FALSE
OPEN ThisFile FOR READ
CLOSEFILE ThisFile
RETURN Valid
ENDFUNCTION
SHAHARYAR LALANI
1 Procedure heading and ending including parameters
2 Declaration and initialisation of local Integer value for ErrCount
3 Use of CheckFile(), output message and terminate if it returns
FALSE
4 Conditional loop until EOF()
5 ...or ErrCount > MaxErrors
6 Read line and use as parameter to CheckLine()in a loop
7 Test return value and increment ErrCount if non-zero in a loop
8 Output either message once only as appropriate
ErrCount 0
REPEAT
READFILE, ThisFile, ThisLine
ThisError CheckLine(ThisLine)
IF ThisError <> 0 THEN
ErrCount ErrCount + 1
ENDIF
UNTIL ErrCount > MaxErrors OR EOF(ThisFile)
CLOSEFILE ThisFile
ENDIF
ENDPROCEDURE
Examples:
1 Incorrect block structure. Missing keyword denoting part of block (for
example ENDPROCEDURE, ENDFUNCTION, ENDTYPE)
2 Data type errors, for example, assigning an integer value to a string
3 Identifier used before it is declared
4 Incorrect parameter use
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.
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
SHAHARYAR LALANI
for a question. Each question paper and mark scheme will also comply with these marking principles.
• 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.
Marks awarded are always whole marks (not half marks, or other fractions).
• 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.
Rules must be applied consistently, e.g. in situations where candidates have not followed
instructions or in the application of generic level descriptors.
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).
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.
SHAHARYAR LALANI
• When a task which is repeated / reused / performed in several places
• When a part of an algorithm performs a specific task
• Reduces complexity of program / program is simplified // subroutine
already available
• Testing / debugging / maintenance is easier
Term: Parameter(s)
1(b) One mark for test stage, one mark for each description point 4
(Max 3 for Description)
Description:
Expression Evaluation
INT(Count / LENGTH(CharList)) 4
SHAHARYAR LALANI
1 Open file in APPEND mode (and subsequent Close)
2 Prompt and Input a student name and mark
3 If mark greater than or equal to 20 jump to step 5
4 Write only the name to the file
5 Repeat from Step 2 for 35 times / the number of students
2(a)(ii) Data in a file is saved after the computer is switched off / stored 1
permanently // no need to re-enter the data when the program is re-run
S1
Input-A Output-X S2
Input-A (none) S2
Input-B Output-W S3
Input-A Output-W S4
3(a) One mark for name, Max two for features (Max 3 in total) 3
SHAHARYAR LALANI
Name: Queue
Features:
1 Each queue element contains one data item
2 A Pointer to the front / start of the queue
3 A Pointer to the back / end of the queue
4 Data is added at back / end and removed from front / start // works on a
FIFO basis
5 May be circular
ALTERNATIVE:
Features:
1 Each node contains data and a pointer to the next node
2 A Pointer to the start of the list
3 Last node in the list has a null pointer
4 Data may be added / removed by manipulating pointers (not moving
data)
5 Nodes are traversed in a specific sequence
6 Unused nodes are stored on a free list // a free-list pointer to the Free
List
SHAHARYAR LALANI
1 Data 'After Group 1' (as shown, including blank cells)
2 Data 'After Group 2' (as shown, including blank cells)
3 Data 'After Group 3' (as shown, including blank cells)
4 SP 'After Group 1' pointing to location 955
5 Final two SPs pointing to locations 952 and 954
SHAHARYAR LALANI
1 Input UserID and use of GetAverage()and assignment
2 Initialisation of Total to zero and Index to 4
3 Conditional loop with Index from 4 to 6
4 Assignment of Last from element SameMonth[Index] in a loop
5 Structure: IF...THEN...ELSE...ENDIF in a loop
6 Correct assignments and final call to Update()after the loop
INPUT UserID
Average GetAverage(UserID)
Total 0
Index 4
INPUT UserID
Average GetAverage(UserID)
Total 0
FOR Index 4 TO 6
Last SameMonth[Index]
IF Average > Last THEN
Total Total + Average
ELSE
Total Total + Last
ENDIF
NEXT Index
SHAHARYAR LALANI
Question Answer Marks
SHAHARYAR LALANI
Mark as follows (multiplication solution), (Max 7):
Num 0
Found FALSE
Try 1
ENDFUNCTION
SHAHARYAR LALANI
Mark as follows:
1 Function heading and ending including parameter and return type
2 Declaration of local Integer value for Num and Try
3 Count-controlled Loop from 1 to ThisValue
4 Multiply Try by Num in a loop
5 Compare Try with ThisValue in a loop
6 ...Immediate return of Num if they are the same in a loop
7 Return –1 if ThisValue not found after loop
Try 1
RETURN -1
ENDFUNCTION
SHAHARYAR LALANI
1 Procedure heading and ending including parameters
2 Conditional loop containing incrementing Index...
3 ...terminating when ErrNum found
4 ...terminating when ErrCode[Index] > ErrNum (i.e. ErrNum
not found)
5 ... OR after element 500 tested
6 Test if found and OUTPUT 'Found' message
7 ...otherwise OUTPUT 'Not Found' message
Index 0
REPEAT
Index Index + 1
UNTIL ErrCode[Index] >= ErrNum OR Index = 500
ENDPROCEURE
SHAHARYAR LALANI
1 Procedure heading and ending as shown
2 Conditional loop correctly terminated
3 An inner loop
4 Correct range for inner loop
5 Comparison (element J with J+1) in a loop
6 Swap elements in both arrays in a loop
7 'No-Swap' mechanism:
• Conditional outer loop including flag reset
• Flag set in inner loop to indicate swap
8 Efficiency (this scenario): terminate inner loop when ErrCode = 999
9 Reducing Boundary in the outer loop
PROCEDURE SortArrays()
DECLARE TempInt, J, Boundary : INTEGER
DECLARE TempStr : STRING
DECLARE NoSwaps : BOOLEAN
Boundary 499
REPEAT
NoSwaps TRUE
FOR J 1 TO Boundary
IF ErrCode[J]> ErrCode[J+1] THEN
//first swap ErrCode elements
TempInt ErrCode[J]
ErrCode[J] ErrCode[J+1]
ErrCode[J+1] TempInt
//now swap corresponding ErrText elements
TempStr ErrText[J]
ErrText[J] ErrText[J+1]
ErrText[J+1] TempStr
NoSwaps FALSE
ENDIF
NEXT J
Boundary Boundary - 1
UNTIL NoSwaps = TRUE
ENDPROCEDURE
SHAHARYAR LALANI
1 Array of records can store mixed data types / multiple data types under
a single identifer
2 Tighter / closer association between ErrCode and ErrText // simpler
code as fields may be referenced together // values cannot get out of
step as with two arrays
3 Program easier to design / write / debug / test / maintain / understand
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.
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
SHAHARYAR LALANI
for a question. Each question paper and mark scheme will also comply with these marking principles.
• 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.
Marks awarded are always whole marks (not half marks, or other fractions).
• 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.
Rules must be applied consistently, e.g. in situations where candidates have not followed
instructions or in the application of generic level descriptors.
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).
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.
SHAHARYAR LALANI
Variable use Data type
SHAHARYAR LALANI
Examples include:
2 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: AddDonorDetails()
Use: Allows user to add details such as name and contact details
1 Declare two (REAL)variables for the two sum values AND initialise both
to zero
2 Prompt AND Input a number
3 If number greater than zero add to positive sum and If number less
than zero add to negative sum
4 Repeat from step 2 if number not zero
5 After loop the Output SumPos and SumNeg
SHAHARYAR LALANI
Check: There are unused elements in the array // The queue is not full
One mark for reason and one mark for reason it could not be completed.
SHAHARYAR LALANI
• 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
Reason:
• Makes the code easier to understand // Describes the purpose of the
identifier // Makes the code easier to debug/test/maintain
Examples:
SHAHARYAR LALANI
1 Function heading and ending including parameters
2 Declaration of local variable for Result / alt mechanism
3 Check for Reject
4 Check for Accept
5 Check for Recheck (or just default to third option)
6 Return Result following a reasonable attempt
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
SHAHARYAR LALANI
1 Declaration and initialisation of local integer for Count
2 Appropriate prompt and two inputs
3 (Conditional) loop while error number input is in range // error code 999
reached
4 …and not end of array
5 Check if this ErrCode needs to be output in a loop
6 if so check for blank error text in a loop
7 Output in both cases
8 ….and increment count in a loop
9 OUTPUT of header and summary including count
PROCEDURE OutputRange()
DECLARE First, Last, Count, Index, ThisErr : INTEGER
DECLARE ThisMess : STRING
DECLARE PastLast: BOOLEAN
Count 0
Index 1
PastLast FALSE
ENDPROCEDURE
SHAHARYAR LALANI
1 (Conditional) loop terminating when item added OR end of array
reached
2 Test for unused element in a loop
3 Assignment of values to arrays // save index of first blank location and
assign after loop
4 Set loop termination if empty element found in a loop
5 Call SortArrays() once
6 Calculation of remaining unused elements and return Integer value (for
both cases)
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