Cambridge International AS & A Level: Computer Science 9618/23
Cambridge International AS & A Level: Computer Science 9618/23
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 October/November 2024 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
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 Subroutine
FOR Index 1 TO 3
IF Safe[Index] = TRUE THEN
Flap[Index] 0
ENDIF
NEXT Index
CASE OF Compound(3)
1(b) 3
Variable Example data value Data type
1(c) 3
Expression Evaluates to
Index MOD 30 10
Total 0
FOR Count 1 TO 100
OUTPUT "Input an integer value"
INPUT NextNumber
IF NextNumber > 0 THEN
Total Total + NextNumber
ENDIF
NEXT Count
OUTPUT Total
Mark as follows:
MP1 Declarations of all variables used
MP2 Loop for 100 iterations
MP3 Prompt and input a value in a loop and
MP4 Test for value > 0 // >=1 in a loop
MP5 Sum the Total in a loop
MP6 Output of Total after the loop
Max 5 marks
ALTERNATIVE:
3(a)(i) 0 is not a valid array / List index value // No 0th element in the array 1
3(a)(ii) 0 to 200 1
3(b) 4
Mark as follows:
MP1 Use of variable as array index and initialisation to 1 / to first element of
array
MP2 Loop for 199 / 200 iterations
MP3 Assign Index+1 to each pointer field in a loop
MP4 Assign 0 to 200th pointer field
MP2 Loop the following until ThisPointer value is 0 (zero) / null pointer
reached
FOR Index 1 TO 5
Lower GB[Index] - 2
Upper GB[Index] + 2 // Lower + 4
IF Mark >= Lower AND Mark <= Upper THEN
//IF Mark <= Upper AND Mark >= Lower THEN
OUTPUT "Check this paper"
ENDIF
NEXT Index
4(b)(i) MP1 Use Mark as the index to the Check array // to specify an array 2
element
MP2 If value of indexed element is TRUE, then the paper will need to be
checked
4(b)(ii) Example:solution 6
PROCEDURE GBInitialise()
DECLARE GBIndex, GBMark, ThisIndex : INTEGER
FOR ThisIndex 0 TO 75
Check[ThisIndex] FALSE // initialise all values
NEXT ThisIndex
FOR GBIndex 1 TO 5
GBMark GB[GBIndex]
FOR ThisIndex GBMark - 2 TO GBMark + 2
Check[ThisIndex] TRUE //Set GBMark 2 to
TRUE
NEXT ThisIndex
NEXT GBIndex
ENDPROCEDURE
Mark as follows:
MP1 Procedure heading and ending
MP2 Initialise Check array to FALSE
MP3 Loop through GB array
MP4 Extract the GB mark
MP5 Loop for 5 elements across GBMark 2 // Check if within GBMark
2
MP6 Assign each element of Check array to TRUE
FOR ThisIndex 0 TO 75
CASE ThisIndex
GB[1] – 2 TO GB[1] + 2 : Check[ThisIndex] TRUE
GB[2] – 2 TO GB[2] + 2 : Check[ThisIndex] TRUE
GB[3] – 2 TO GB[3] + 2 : Check[ThisIndex] TRUE
GB[4] – 2 TO GB[4] + 2 : Check[ThisIndex] TRUE
GB[5] – 2 TO GB[5] + 2 : Check[ThisIndex] TRUE
OTHERWISE: Check[ThisIndex] FALSE
ENDCASE
NEXT ThisIndex
FOR ThisIndex 0 TO 75
For GBIndex 1 T0 5
Lower GB[GBIndex] - 2
Higher GB[GBIndex] + 2
IF ThisIndex >= Lower AND ThisIndex <= Higher
THEN
Check[ThisIndex] TRUE
ELSE
Check[ThisIndex] FALSE
ENDIF
NEXT Index
NEXT ThisIndex
Mark as follows:
MP1 Procedure heading and ending
MP2 Loop through Check array// loop from 0 to 75
MP3 Attempt at using CASE / Selection structure with five clauses/ five
checks for range
MP4 Extract GB grade
MP5 Compare ThisIndex with each element in GB array 2
MP6 Assign each element of Check array to TRUE if in range or FALSE if
not in range
5(a) 4
Name of life
Activity
cycle stage
5(b) One mark for method – two marks for the description 3
6 Loop Solution 7
Example solution:
ThisDayNumber 0
SundayCount 0
REPEAT
ThisDayNumber ThisDayNumber + 1
ThisDate SETDATE(ThisDayNumber, 3, ThisYear)
IF DAYINDEX(ThisDate) = 1 THEN
SundayCount SundayCount + 1
ENDIF
UNTIL SundayCount = 3
RETURN ThisDayNumber
ENDFUNCTION
Mark as follows:
MP1 Function heading, parameter, ending and return type
MP2 Declare local integer variable that is used to create a date
MP3 Loop until 3rd Sunday found
MP4 Attempt to use both SETDATE() and DAYINDEX() in a loop
MP5 Correctly generate value of type DATE using SETDATE() in a loop
MP6 Test if value represents a Sunday using DAYINDEX() in a loop
MP7 Increment Sunday count in a loop and initialised correctly before loop
MP8 Return day number of third Sunday
Max 7 marks
Non-loop solution
Example solution:
6 Mark as follows:
MP1 Function heading, parameter, ending and return type
MP2 Declare local integer variable that is used to hold a day number
MP4 Attempt to use both SETDATE() and DAYINDEX()
MP5 Correctly generate value of type DATE using SETDATE() for first of
March / specific day in March
MP6 Test if date represents a Sunday / specific day using DAYINDEX()
and calculate third Sunday // Correctly calculate third Sunday for a
value returned by DAYINDEX()for one day
MP7 Calculate third Sunday for other six days
MP8 Return day number of third Sunday
Max 7 marks
MP1 Analysis
Max 2 marks
Mark as follows:
Examples include:
Sub-module: GetPoints()
Use: Get the number of points the customer has
Sub-module: CalculatePoints()
Use: Calculate points (following a purchase)
Sub-module: UpdatePoints()
Use: Update total points a customer has (following a purchase)
Sub-module: ShowDiscount()
Use: Display the discount
Max 4 marks
Num 0
Total 0
FOR Index 1 TO 45
IF Character[Index].Player = ThisPlayer AND __
Character[Index].Role = ThisRole THEN
Num Num + 1
Total Total + Character[Index].SkillLevel
NEXT Index
ENDPROCEDURE
MP6 ... if player and role found, increment Num and sum Skill Total in a
loop
MP7 Test for any matches after the loop
MP8 Both possible OUTPUT statements correctly formed following an
attempt at MP6 but outputting one only
Max 7 marks
PROCEDURE Restore()
DECLARE Index : INTEGER
DECLARE Line : STRING
CLOSEFILE "SaveFile.txt"
ENDPROCEDURE
Mark as follows:
MP1 Open the file in read mode and subsequently close
MP2 Loop through 45 elements
MP3 Read a line from the file in a loop
MP4 Attempt to use Extract() in a loop
MP5 Correct use of Extract() for all fields in a loop
MP6 Use of STR_TO_NUM() on Player and Skill in a loop
MP7 Completely correct extraction and assignment of all fields in a loop
8(c) MP1 The Character array / character data can be saved before the 2
program is closed
MP2 Allowing the game to continue using the same data / from the point it
was saved