Cambridge International AS & A Level: Computer Science 9618/22
Cambridge International AS & A Level: Computer Science 9618/22
com
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 2024 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
descriptions 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.
Note: No marks are awarded for using brand names of software packages or hardware.
1(a) 4
Pseudocode example Selection Iteration Input/Output
FOR Index 1 TO 10
Data[Index] 0
NEXT Index
WRITEFILE ThisFile,
"****"
1(b) 4
Expression
Any of:
Any of:
2(a) 5
Mark points
1 Condition for selecting one of the input numbers as largest value
2 … and assign to Ans
3 Condition for selecting largest number for all three number input and
assigning to Ans
4 Average calculated using Num1, Num2 and Num3 and stored in a variable.
Reject use of DIV
5 Output of Ans and average in output symbol / parallelogram
Flag GetStat()
WHILE Flag <> TRUE
FOR Port 1 TO 3
CALL Reset(Port)
NEXT Port
Flag GetStat()
ENDWHILE
Alternative:
REPEAT
Flag GetStat()
IF Flag <> TRUE THEN
FOR Port 1 TO 3
CALL Reset(Port)
NEXT Port
ENDIF
UNTIL Flag = TRUE
3(a)(i) Pseudocode: 4
TYPE Component
DECLARE Item_Num : INTEGER
DECLARE Reject : BOOLEAN
DECLARE Stage : CHAR
DECLARE Limit_1 : REAL
DECLARE Limit_2 : REAL
ENDTYPE
Mark as follows:
1 Allows for iteration / can use a loop to access the records / data items
2 Use of index to directly access a record in the array // Example of
simplification of code e.g. use of dot notation Item[1].Stage
3 Simplifies the code / algorithm // Reduces duplication of code // Program
easier to write / understand / maintain / test / debug // Data items/record
easier to search / sort / manipulate
4 Example solution: 5
PROCEDURE IsRA()
DECLARE a, b, c : INTEGER
IF (a * a = (b * b) + (c * c)) OR__
(b * b = (a * a) + (c * c)) OR__
(c * c = (a * a) + (b * b)) THEN
OUTPUT "It is right-angled"
ELSE
OUTPUT "Not right-angled"
ENDIF
ENDPROCEDURE
Mark as follows:
Syntax:
1. NEXT Index (should be ENDWHILE)
2. '&' used to concatenate an integer (in OUTPUT statement)
Other:
3. Accesses element outside range // Accesses element 0
Statement:
The OTHERWISE statement
Explanation:
The result of MOD 2 can only be 0 or 1
5(b) Run-time 1
ENDFUNCTION
Mark as follows:
1. Function heading, ending, parameter and return type
2. If length of original string <= 16 then return original string
3. Any Conditional loop...
4. until string is short enough
5. Inner conditional loop / second condition to identify word(s) to
remove from the end of string // Check to identify word(s) to remove
from the end of string
6. Attempt to strip characters back to space
7. Correct removal of word/words from end of string and remove final
space
8. Concatenate Dots and return result
Max 7 marks
6(b)(i) A (very) large file is created // redundant zeroes are stored in the file 1
Max 1 mark
6(b)(iii) The algorithm to store / extract / separate the individual values is more 1
complex / takes longer to execute / run / process
Module: IdentifyMember()
Use: Identifies a club member who has expressed an interest in a given class
Module: GetMemberPhoneNumber()
Use: Gets the mobile phone number of a member
Module: CreateMessage()
Use: Generates a text message to a member
Module: SendMessage()
Use: Sends a text message to a member in the waiting list
7(b)(i) 5
Input Output Next state
S1
Input-A none S3
Input-A Output-W S3
Input-B none S2
Input-B none S5
Input-A none S2
Input-A Output-X S4
8(b) Example algorithm based on finding position of first non-space character and 6
then using substring function:
NumSpaces 0
EndOfLeading FALSE
RETURN NewLine
ENDFUNCTION
Mark as follows:
8(c) Example: 8
Count 0
CLOSEFILE F1
CLOSEFILE F2
ENDPROCEDURE
Mark as follows: