CS 2-24
CS 2-24
INSERT 2 hours
INFORMATION
*6806807822-I*
DC (SL) 342707
© UCLES 2024 [Turn over
2
An error will be generated if a function call is not properly formed or if the parameters are of an incorrect
type or an incorrect value.
Numeric functions
Date functions
Date format is assumed to be DD/MM/YYYY unless otherwise stated.
Operators
An error will be generated if an operator is used with a value or values of an incorrect type.
Comparison operators
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge
Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.
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.
(A XOR B) NOR C
Monitoring:
The turning on of the digital camera does not affect the input to the
sensor/button
The transmission of the data/video does not affect the input to the
sensor/button
The ringing of the doorbell does not affect the input to the button
Control:
Video doorbell does not only store the values from the motion sensor
The data is processed, generating a signal to start the digital camera
recording
Button pressed/motion detected causes a signal to be sent over a
network to the smartphone
Statement Answer
The two types of logic gate that can be used to create solid NAND
state devices NOR
The type of gate that can retain electrons without power floating
The type of gate that allows or stops current from passing control
through
1 LDD 20 4
ADD #2
2 LDX 22 5
3 LDI 25 1
INC ACC
SUB 22
4 LDD 19 25
LDM #5
LDM #25
odd or even
7-bits
odd
block
byte
In a parity block check the bytes are grouped together, for example in a grid.
The number of 1s in each column (bit position) is counted. A bit is assigned to
each column to make the column match the parity. These parity bits are
transmitted with the data as a parity byte.
e.g.
Captures an image of the face
Uses image recognition
Trained to identify the features of a face in an image
… using a large number of images
Analyse images for facial features
Uses the probability of a match
Quiz table with Quiz ID or date or file name as the Primary Key.
… containing at least the other field(s) not used as the PK
A joining table with an appropriate name including at least fields for user
identification, quiz identification and score
… with an appropriate Primary Key
... and Foreign Keys matching the Primary Keys of the other two tables
6(b) 1 mark each to max 2 for data dictionary and max 2 for logical schema: 4
Data dictionary:
Data about the data in the database // metadata
Identifies the characteristics of the data that will be stored
Appropriate example e.g. field names, table name, validation rules, data
types, primary / foreign keys, relationships etc.
Logical schema:
Conceptual design
Platform/database independent overview of the database
Is used to design the physical structure
Appropriate example e.g. Design of entities / E-R diagram / views
Example:
SELECT PlayerID, COUNT(EventID)
FROM EVENT
GROUP BY PlayerID;
7 1 mark each: 3
Example:
10011110
01100001
+ 00011001
(1) 0 0 0 1 1 0 0 0
1 1 1 1 1 1 1........................(carries)
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.
NAND
The output is 0 when both inputs are 1, otherwise the output is 1
NOR
The output is 1 when both inputs are 0, otherwise the output is 0
XOR
The output is 1 when one of the inputs is 1 and the other input is 0,
otherwise the output is 0
OR
The output is 0 when both inputs are 0, otherwise the output is 1
(LCD) displays/screens/lenses
gyroscope/accelerometer
direction/speed
digital cameras
The buffer is used as a temporary store for data going to the headset
Data is transferred into the buffer by the computer
Data is retrieved from the buffer by the headset
When the buffer is empty/full an interrupt is sent to the computer
requesting more data/stopping further data being sent
When the headset has enough data/needs more data, an interrupt is sent
by the headset to the computer to stop sending data from buffer
Firewall
Checks incoming connections
... against criteria
Blocks data from entering specific ports
Blocks data that does not meet whitelist that meets blacklist
Proxy server
Prevents devices accessing the web server directly
Intercepts any requests
Forwards the request using its own IP address
Screens returning data before sending it to the user
Encryption
Encodes/scrambles data
... so if it is intercepted it cannot be understood
Algorithm/key is required to decode the data
Data is not stored on the Exam papers are stored on the server and
client computer not on the examiner’s computer // exam
papers are not permanently stored on the
examiners’ computers
Client computer requires few Examiners can use devices with low
local resources/memory resources and the marking software will still
function
1-to-many
Example:
CREATE TABLE EXAM(
ExamID varchar NOT NULL,
Subject varchar,
Level int,
TotalMarks int,
PRIMARY KEY(ExamID)
);
Example.
ALTER TABLE EXAM_QUESTION
ADD FOREIGN KEY (ExamID) REFERENCES EXAM(ExamID);
A linking table between STUDENT and EXAM with suitable Primary Key
and appropriate name
… that includes the Primary Key of the STUDENT table as a Foreign Key
to join with STUDENT
... and includes the Primary Key of the EXAM table as a Foreign Key to
join with EXAM
1 LDI 15 11
SUB #1
2 LDD 14 13
ADD 11
3 LDM #11 2
ADD #3
SUB 16
4 LDR #2 14
LDX 14
ADD #2
3300 kibibytes
100 + (-10):
01100100
+1 1 1 1 0 1 1 0
(1) 0 1 0 1 1 0 1 0
Carries: 1 1 0 0 1 0 0 0
Borrows:
00011010
01100100
–00001010
01011010
8(b) 1 mark for identification of each feature and 1 mark for matching description: 6
e.g.
For coding:
IDE feature Description
For presentation:
IDE feature Description
Expand/collapse (code) The user can hide code that they are not
blocks currently working on
For debugging:
IDE feature Description
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.
binary
3072
denary/decimal
2000
A kibibyte has a binary prefix. Three kibibytes is the same as 3072 bytes.
A megabyte has a decimal/denary prefix. Two terabytes is the same as 2000
gigabytes.
The answer is too long to be represented in the same number of bits as the
binary numbers being added
ASCII 7
extended ASCII 8
Unicode 16/32
The file takes less storage space on the web server than if lossless
compression was used
The file is faster to upload/download to/from the server than if lossless
compression was used
The file uses less bandwidth to transmit than if lossless compression was
used
The file consumes less data allowance than if lossless compression was
used
Colour/bit depth
Image resolution
1 LDM #50 50
INC ACC
SUB #1
2 LDI 51 97
ADD 52
3 LDR #2 48
LDX 50
DEC ACC
4 LDD 52 44
SUB 54
INC ACC
Example:
CREATE TABLE PERFORMANCE(
PerformanceID varchar NOT NULL,
ShowID varchar,
ShowDate Date,
StartTime Time,
PRIMARY KEY(PerformanceID),
FOREIGN KEY(ShowID) REFERENCES SHOW(ShowID)
);
Example 1:
SELECT SHOW.Title, Count(PERFORMANCE.PerformanceID)
AS NumberOfShowings
FROM PERFORMANCE, SHOW
WHERE PERFORMANCE.ShowID = SHOW.ShowID
GROUP BY SHOW.Title;
Example 2:
SELECT SHOW.Title, Count(PERFORMANCE.PerformanceID)
AS NumberOfShowings
FROM PERFORMANCE INNER JOIN SHOW
ON PERFORMANCE.ShowID = SHOW.ShowID
GROUP BY SHOW.Title;
e.g.
A linking table between Table 2 and SEAT with suitable Primary Key and
appropriate name
… that includes the Primary Key of Table 2 as a Foreign Key to join with
Table 2
… that stores the SeatID.
e.g.
Not reliant on a third party
… gives greater control over security/privacy
… gives greater control over backup
Storage can be tailored/scalable to company requirements// an example
e.g. the amount of storage accessible/ facilitating the sharing of files
Static means the IP for that device does not change and Private means it can
only be accessed/seen/used within the LAN
e.g.
Voice/speech recognition is used
... to identify if someone speaking
The sound is recorded and analysed
The audio recordings are compared to a database of words/sound waves
... to identify the word that has the highest probability of being said
Natural language recognition is used
Words are combined and compared to known sentences
… programmed action(s) for matching sentence(s) are performed
Method Description
Checksum A calculation is made from the data and the result transmitted
with the data. The receiver repeats the calculation and
compares the result with the value received. If the two are
different, there is an error.
Encodes/scrambles data
... so if it is intercepted it cannot be understood
Algorithm/key is required to decode the data
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
Assignment statement Data type
C INT(ItemCost) / 3 REAL
1(b) 4
Expression Evaluates to
Tries MOD 4 1
1(c)(i) The names do not reflect / indicate the purpose of the variable // the names 1
are not meaningful
1(c)(ii) They make the program more difficult to understand / debug / maintain 1
2(a) 5
The values stored in the two variables will indicate the first
element in each list
The first 1D array will be used to store the values // data items
// User IDs
Mark as follows:
4 Example: 6
Odd 0
Even 0
ENDFUNCTION
Mark as follows:
1. Function heading, ending and return type
2. Declare local variables Odd, Even and Index as integers
3. Initialise Odd and Even
4. Loop for 100 iterations // through array
5. Sum Odd and Even element values in a loop
6. Compare Odd and Even after the loop and Return appropriate string
5(a) 6
5(b)(ii) After the 'Z' clause in the CASE construct // before the ENDCASE 1
ENDFUNCTION
Mark as follows:
Problem:
The function will return an incorrect value // the test will fail
Solution:
Round the calculated values (to a known number of decimal places)
Define a threshold below which any difference can be ignored
Item: name
Justification: to personalise the text message
Max 2 marks
7(b)(i) 2
Means that Update calls (one of) either Sub-A, Sub-B or Sub-C
NewLine Line
TrimTo 0
Count 1
WHILE Count < LENGTH(Line) AND TrimTo = 0
TwoChars MID(Line, Count, 2) // extract 2 chars
IF TwoChars = Comment THEN
TrimTo Count
ENDIF
Count Count + 1
ENDWHILE
RETURN NewLine
ENDFUNCTION
Mark as follows:
8(b) Example: 7
CLOSEFILE OldFile
CLOSEFILE NewFile
RETURN Count
ENDFUNCTION
Mark as follows:
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:
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(b) 4
Pseudocode expression Evaluates to
MID("Random", 2, 3) "and"
5 + DAY(10/11/2023) 15
IS_NUM("45000") TRUE
(20 MOD 3) + 1 3
ALTERNATIVE:
Mark as follows:
1. Reference to Batch[ThisIndex].Weight
2. A valid check for one boundary
3. A valid check for other boundary with correct logic operator
3(b) 5
Zone 1
Zone 2
Zone 3
Zone 4
Zone 5
PROCEDURE TwoParts()
DECLARE NextNum, Average : REAL
TotalA 0.0 // 0
TotalB 0.0 // 0
REPEAT
INPUT NextNum
TotalA TotalA + NextNum
UNTIL NextNum = 0
REPEAT
INPUT NextNum
TotalB TotalB + NextNum
UNTIL NextNum = 0
Mark as follows:
1. Procedure heading and ending
2. Declare all local variables
3. Initialise TotalA and TotalB
4. First conditional loop until zero entered, summing TotalA // Loop until
both parts (sequences) have been entered
5. Second conditional loop until zero entered, summing TotalB // Loop
summing appropriate Totals
6. Calculation of average and output with a message // Calculation of the
average for the values making up the two totals and both output with a
suitable message
Marks as follows:
1 mark for array
1 mark for 20 reals
Count-controlled loop
the number of iterations is known
1 The functions will return the same value every time they are called
2 ... because Label / the parameter value does not change within the loop
Alternative:
6(b)(ii) The progress display will more accurately show the progress of the task 1
Mark as follows:
1 mark for a reasonable attempt to explain
2 marks for full explanation including context
7(b) 6
8(a) Example: 7
RETURN ""
ENDFUNCTION
Mark as follows:
8(b) Example: 8
Index 1
LineNum 0
CLOSEFILE FileName
ENDPROCEDURE
Mark as follows:
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.
Mantissa Exponent
1 0 0 1 1 0 0 1 0 1 0 0 0 1 1 1
Application
Transport
Internet
Link
2(c) One mark for name of protocol and one mark for expansion (Max 2) 2
HTTP(S) – responsible for correct transfer of files / hypertext documents that make up web pages on the world wide web
Example answer
TYPE FootballClub
DECLARE TeamName : STRING
DECLARE DateOfJoining : DATE
DECLARE MainTelephone : STRING
DECLARE ManagerName : STRING
DECLARE NumberOfMembers : INTEGER
DECLARE LeaguePosition : INTEGER
ENDTYPE
Complete answer
7 3 + 2 8 * - 6 /
5 7 7 10 10
17 17 12 12 12 12 120 120 12
Working space
A B C P Q R S Z
0 0 0 1 0 0 1 1
0 0 1 1 0 0 1 1
0 1 0 0 0 0 0 0
0 1 1 0 0 0 0 0
1 0 0 1 0 0 0 0
1 0 1 1 0 1 0 1
1 1 0 0 0 0 1 1
1 1 1 0 1 0 1 1
6(b) Two marks for all five correct terms and no extras 2
One mark for any three correct terms
BC
A 00 01 11 10
0 1 1 0 0
1 1 1 1 1
BC
A 00 01 11 10
0 1 1 0 0
1 1 1 1 1
6(c)(iii) A+B 1
(23) feature(sliding_doors).
(24) available(sliding_doors, minivan).
(25) unavailable(sliding_doors, hatchback).
Example answers
may_choose_option(F, B)
IF
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.
Mantissa Exponent
0 1 1 0 1 1 0 1 1 0 1 0 0 1 1 0
Example answer
TYPE Numbers = SET OF INTEGER
DEFINE EvenNumbers (2, 4, 6, 8, 10, 12): Numbers
Complete answer
7 2 – 8 + 9 5 - /
3 7
9 6 6 9 9 2
6 6 15 15 15 15 15 15 30
Or
(a – c + b) * (d + b)/c
Working space
A B C P Q R S T Z
0 0 0 1 1 1 1 1 0
0 0 1 1 1 0 1 0 1
0 1 0 1 0 1 1 0 1
0 1 1 1 0 0 1 0 1
1 0 0 0 1 1 0 0 0
1 0 1 0 1 0 1 0 1
1 1 0 0 0 1 1 0 1
1 1 1 0 0 0 1 0 1
BC
00 01 11 10
A
0 1 0 1 1
1 1 0 1 1
BC
00 01 11 10
A
0
0 1 1 1
1 1 0 1 1
6(c)(iii) B+C 1
8(b) Max 4 4
One mark per mark point (Max 3)
MP1 Linear search sequentially checks each element of the array / list.
MP2 … until the matching element is found, or the end of the array / list is reached.
MP3 Binary search finds the mid-point of an array/list and determines which side contains the item to be found
MP4 … it discards the half of the array/list not containing the search item // … it finds the position of a target value within
an array / list by repeatedly halving the target search field.
MP5 The binary search requires the elements to be sorted // The linear search does not require the elements to be
sorted.
MP6 The binary search will usually do many fewer comparisons of records/iterations against the target than a linear
search before it finds its target.
MP7 Linear search starts at the beginning of the array/list and binary search starts in the middle of the array/list.
9(a) One mark per mark point for up to two benefits (Max 2) 4
MP1 COMPATIBILTY e.g. Applications that aren’t compatible with the host computer can be run on the virtual machine
// It is possible to emulate old software on a new system by running a compatible guest operating system as a
virtual machine // Software can be tried on different OS on the same hardware.
MP2 PROTECTION e.g. The guest operating system has no effect on anything outside the virtual machine other virtual
machines or the host computer//Virtual machines are useful for testing as they will not crash the host computer if
something goes wrong // Easier to recover if software causes a system crash as virtual machine software protects
the host system.
MP3 COST e.g. No need to buy extra computers / hardware as multiple virtual machines can be implemented on the
same hardware.
9(b) One mark per mark point – host operating system (Max 2) 3
MP1 The host operating system is the normal operating system for the host computer / machine.
MP2 It has control of all the resources of the host computer / machine. // It can access the physical resources of the
host computer / machine.
MP3 It provides a user interface to operate the virtual machine software.
MP4 It also runs the virtual machine software.
Example answer
(25) client(jane).
(26) activity(surfing).
(27) choice(jane, surfing).
(28) done(jane, sailing).
Example answers
may_choose_activity(C, A)
IF
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.
Mantissa Exponent
1 0 0 1 1 0 0 1 0 1 0 0 0 1 1 1
Application
Transport
Internet
Link
2(c) One mark for name of protocol and one mark for expansion (Max 2) 2
HTTP(S) – responsible for correct transfer of files / hypertext documents that make up web pages on the world wide web
Example answer
TYPE FootballClub
DECLARE TeamName : STRING
DECLARE DateOfJoining : DATE
DECLARE MainTelephone : STRING
DECLARE ManagerName : STRING
DECLARE NumberOfMembers : INTEGER
DECLARE LeaguePosition : INTEGER
ENDTYPE
Complete answer
7 3 + 2 8 * - 6 /
5 7 7 10 10
17 17 12 12 12 12 120 120 12
Working space
A B C P Q R S Z
0 0 0 1 0 0 1 1
0 0 1 1 0 0 1 1
0 1 0 0 0 0 0 0
0 1 1 0 0 0 0 0
1 0 0 1 0 0 0 0
1 0 1 1 0 1 0 1
1 1 0 0 0 0 1 1
1 1 1 0 1 0 1 1
6(b) Two marks for all five correct terms and no extras 2
One mark for any three correct terms
BC
A 00 01 11 10
0 1 1 0 0
1 1 1 1 1
BC
A 00 01 11 10
0 1 1 0 0
1 1 1 1 1
6(c)(iii) A+B 1
(23) feature(sliding_doors).
(24) available(sliding_doors, minivan).
(25) unavailable(sliding_doors, hatchback).
Example answers
may_choose_option(F, B)
IF
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.
VB.NET
Dim DataStored(19) As Integer
Dim NumberStored As Integer = 0
Python
global DataStored #integer
global NumberItems #Integer 20 items
VB.NET
Sub Initialise()
Console.WriteLine("How many numbers will you enter?")
Dim Quantity As Integer
Do
Quantity = Console.ReadLine()
Loop Until (Quantity > 0 And Quantity < 21)
For Count = 0 To Quantity - 1
Console.WriteLine("Enter number")
DataStored(NumberStored) = Console.ReadLine()
NumberStored += 1
Next
End Sub
1(b) Python
def Initialise():
global DataStored
global NumberItems
Valid = False
while(Valid == False):
NumberItems = int(input("How many numbers will you enter?")) #loop until < 20
if NumberItems > 0 and NumberItems< 21:
Valid = True
for Count in range(0, NumberItems):
DataStored.append(int(input("Enter number")))
VB.NET
NumberItems = 0
Initialise()
For X = 0 To NumberItems - 1
Console.WriteLine(DataStored(X))
Next
Python
NumberItems = 0
Initialise()
print(DataStored)
1(d)(i) Python
def BubbleSort():
global DataStored
global NumberItems
for Count in range(0, NumberItems):
for Count2 in range(0, NumberItems-1):
if DataStored[Count2] > DataStored[Count]:
DataStored[Count2], DataStored[Count] = DataStored[Count],
DataStored[Count2]
1(d)(ii) 1 mark for calling BubbleSort() and outputting array contents after 1
e.g.
VB.NET
BubbleSort()
For X = 0 To NumberStored - 1
Console.WriteLine(DataStored(X))
Next
e.g. Java
BubbleSort();
for(Integer X = 0; X < NumberItems; X++){
System.out.println(DataStored[X]);
}
e.g. Python
BubbleSort()
print(DataStored)
1(d)(iii) 1 mark for screenshot showing the inputs and the values in the correct order 1
e.g.
1(e)(i) VB.NET
Function BinarySearch(DataToFind)
Dim First As Integer = 0
Dim Last As Integer = NumberItems
Dim MidValue As Integer
While (First <= Last)
MidValue = (First + Last) / 2
If DataToFind = DataStored(MidValue) Then
Return MidValue
End If
If DataToFind < DataStored(MidValue) Then
Last = MidValue - 1
Else
First = MidValue + 1
End If
End While
Return -1
End Function
Python
def BinarySearch(DataToFind):
global DataStored
global NumberItems
First = 0
Last= NumberItems
while(First <= Last):
MidValue = int((First + Last) / 2)
if DataToFind == DataStored[MidValue]:
return MidValue
if DataToFind < DataStored[MidValue]:
Last = MidValue - 1
else:
First = MidValue + 1
return -1
VB.NET
Console.WriteLine("Enter a number to find")
Dim Search As Integer = Console.ReadLine()
Console.WriteLine(BinarySearch(Search))
Python
Search = int(input("Enter a number to find"))
print(BinarySearch(Search))
Test 2
public Tree(String Name, Integer HGrowth, Integer MaxH, Integer MaxW, String
PEvergreen){
TreeName = Name;
HeightGrowth = HGrowth;
MaxWidth = MaxW;
MaxHeight = MaxH;
Evergreen = PEvergreen;
}}
2(a)(i) VB.NET
Class Tree
Private TreeName As String
Private HeightGrowth As Integer
Private MaxHeight As Integer
Private MaxWidth As Integer
Private Evergreen As String
Sub New(Name, HGrowth, MaxH, MaxW, PEvergreen)
TreeName = Name
HeightGrowth = HGrowth
MaxHeight = MaxH
MaxWidth = MaxW
Evergreen = PEvergreen
End Sub
End Class
Python
class Tree:
def __init__(self, Name, HGrowth, MaxH, MaxW, PEvergreen):
self.__TreeName = Name
self.__HeightGrowth = HGrowth
self.__MaxHeight = MaxH
self.__MaxWidth = MaxW
self.__Evergreen = PEvergreen
2(a)(ii) VB.NET
Function GetTreeName()
Return TreeName
End Function
Function GetMaxHeight()
Return MaxHeight
End Function
Function GetMaxWIdth()
Return MaxWidth
End Function
Function GetGrowth()
Return HeightGrowth
End Function
Function GetEvergreen()
Return Evergreen
End Function
Python
def GetTreeName(self):
return self.__TreeName
def GetMaxHeight(self):
return self.__MaxHeight
def GetMaxWidth(self):
return self.__MaxWidth
def GetGrowth(self):
return self.__HeightGrowth
def GetEvergreen(self):
return self.__Evergreen
}catch(FileNotFoundException e){
System.out.println("File not found");
}
return TreeData;
}
2(b) VB.NET
Function ReadData()
Dim TreeObjects(10) As Tree
Dim TextFile As String = "Trees.txt"
try
Dim FileReader As New System.IO.StreamReader(TextFile)
Dim TreeData(10) As String
Dim TreeSplit() As String
For Count = 0 To 8
TreeData(Count) = FileReader.ReadLine()
Next Count
FileReader.Close()
For X = 0 To 8
TreeSplit = TreeData(X).Split(",")
TreeObjects(X) = New Tree(TreeSplit(0), Integer.Parse(TreeSplit(1)),
Integer.Parse(TreeSplit(2)), Integer.Parse(TreeSplit(3)), TreeSplit(4))
Next X
Catch ex As Exception
Console.WriteLine ("invalid file")
End Try
Return TreeObjects
End Function
2(b) Python
def ReadData():
TreeObjects=[]
try:
File = open("Trees.txt")
TreeData = []
TreeData = File.read().split("\n")
SplitTrees = []
for Item in TreeData:
SplitTrees.append(Item.split(","))
File.close()
for Item in SplitTrees:
TreeObjects.append(Tree(Item[0],int(Item[1]),int(Item[2]),int(Item[3]),Item[4]))
except IOError:
print ("invalid file")
return TreeObjects
e.g.
Java
public static void PrintTrees(Tree TreeItem){
String Final = "does not lose its leaves";
if((TreeItem.GetEvergreen()).compareTo("No") == 0){
Final = "loses its leaves each year";
}
System.out.println(TreeItem.GetTreeName() + " has a maximum height " +
TreeItem.GetMaxHeight() + " a maximum width " + TreeItem.GetMaxWidth() + " and grows " +
TreeItem.GetGrowth() + " cm a year. It " + Final);
}
VB.NET
Sub PrintTrees(Item)
Dim Final As String = "does not lose its leaves"
If (Item.GetEvergreen() = "No") Then
Final = "loses its leaves each year"
End If
Console.WriteLine(Item.GetTreeName() & " has a maximum height " &
Item.GetMaxHeight() & " a maximum width " & Item.GetMaxWidth() & " and grows " &
Item.GetGrowth() & "cm a year. It" & Final)
End Sub
2(c) Python
def PrintTrees(Item):
e.g.
Java
Tree[] TreeData = new Tree[20];
TreeData = ReadData();
PrintTrees(TreeData[0]);
VB.NET
Sub Main(args As String())
Dim TreeObjects(10) As Tree
TreeObjects = ReadData()
PrintTrees(Treeobjects(0))
End Sub
Python
TreeObjects = ReadData()
PrintTrees(TreeObjects[0])
e.g.
Java
public static void ChooseTree(Tree[] Trees){
Scanner scanner = new Scanner(System.in);
System.out.println("Do you want a tree that loses its leaves (enter lose), or keeps
its leaves (enter keep)") ;
String Evergreen = (scanner.nextLine());
System.out.println("What is the maximum tree height in cm");
Integer MaxHeight = Integer.parseInt(scanner.nextLine());
System.out.println("What is the maximum tree width in cm");
Integer MaxWidth = Integer.parseInt(scanner.nextLine());
Tree[] Options = new Tree[20];
String keep;
Tree Selected;
Boolean Valid = false;
if(((Evergreen.toLowerCase()).compareTo("keep") == 0) ||
((Evergreen.toLowerCase()).compareTo("keep leaves") == 0) ||
((Evergreen.toLowerCase()).compareTo("keeps its leaves") == 0)){
keep = "Yes";
}else{
keep = "No";
}
Integer Counter = 0;
for(Integer X = 0; X < 9; X++){
VB.NET
Sub ChooseTree(Trees)
Console.WriteLine("Do you want a tree that loses its leaves (enter lose), or keeps
its leaves (enter keep)")
Dim Evergreen As String = Console.ReadLine()
Console.WriteLine("What is the maximum tree height in cm")
Dim MaxHeight As Integer = Console.ReadLine()
Console.WriteLine("What is the maximum tree width in cm")
Dim MaxWidth As Integer = Console.ReadLine()
Dim Options(0 To 9) As Tree
Dim keep As String
Dim Valid As Boolean
Dim Selected As Tree
If Evergreen.ToLower() = "keep" Or Evergreen.ToLower() = "keep leaves" Or
Evergreen.ToLower() = "keeps its leaves" Then
keep = "Yes"
Else
keep = "No"
2(e)(i) End If
Dim count As Integer = 0
For x = 0 To 8
If Trees(x).GetMaxHeight() <= MaxHeight And Trees(x).GetMaxWidth() <= MaxWidth
And keep = Trees(x).GetEvergreen() Then
Options(count) = Trees(x)
PrintTrees(Trees(x))
count = count + 1
End If
Next x
If count = 0 Then
Console.WriteLine("No suitable trees")
End If
End Sub
Python
def ChooseTree(Trees):
Evergreen = input("Do you want a tree that loses its leaves (enter lose), or keeps its
leaves (enter keep)")
MaxHeight = int(input("What is the maximum tree height in cm"))
MaxWidth = int(input("What is the maximum tree width in cm"))
Options = []
if Evergreen.lower() == "keep" or Evergreen.lower() == "keep leaves" or
Evergreen.lower() == "keeps its leaves":
keep = "Yes"
else:
keep = "No"
for Item in Trees:
2(e)(ii) Java
Integer Start;
Float Height;
Float Growth;
Float Years;
while(Valid == false){
System.out.println("Enter the name of the tree you want");
String Choice = scanner.nextLine();
for(Integer X = 0; X < Counter; X++){
if((Options[X].GetTreeName()).compareTo(Choice)==0){
Valid = true;
Selected = Options[X];
System.out.println("Enter the height of the tree you would like to start
with in cm");
Start = Integer.parseInt(scanner.nextLine());
Height = (Selected.GetMaxHeight()).floatValue();
Growth = (Selected.GetGrowth()).floatValue();
Years = (Height - Start) / Growth;
System.out.println("Your tree should be full height in approximately "+
Years + " years");
}
}
}
Python:
Valid = False
while Valid == False:
Choice = input("Enter the name of the tree you want")
for Item in Options:
if Item.GetTreeName() == Choice:
Valid = True
Selected = Item
Start = int(input("Enter the height of the tree you would like to start with in
cm"))
Years = (Selected.GetMaxHeight() - Start)/Selected.GetGrowth()
print("Your tree should be full height in approximately", Years,"years")
Python
global QueueData
global QueueHead
global QueueTail
QueueData = []
for x in range(0, 20):
QueueData.append("")
QueueHead = -1
QueueTail = -1
3(b) Python
def Enqueue(DataToInsert):
global QueueData
global QueueHead
global QueueTail
if QueueTail == 19:
return False
elif QueueHead == -1:
QueueHead = 0
QueueTail = QueueTail + 1
QueueData.append(DataToInsert)
return True
3(c) Python
def Dequeue():
global QueueData
global QueueHead
global QueueTail
if QueueHead < 0 or QueueHead > 20 or QueueHead > QueueTail:
return False
else:
QueueHead = QueueHead + 1
return QueueData[QueueHead-1]
VB.NET
Sub StoreItems()
End Sub
3(d)(i) Python
def StoreItems():
global QueueData
global QueueHead
global QueueTail
Count = 0
for X in range(0, 10):
Data = input("Enter data")
Total= int(Data[0]) + int(Data[1]) * 3 + int(Data[2]) + int(Data[3]) * 3 +
int(Data[4]) + int(Data[5]) * 3
Total = int(Total / 10)
if((Total == 10 and Data[6] == "X") or (Total == int(Data[6]))):
Result = Enqueue(Data[0:6])
if(Result == True):
print("Inserted item")
else:
print("Queue full")
else:
Count = Count + 1
End Sub
3(d)(ii) Python
QueueData = []
for x in range(0, 20):
QueueData.append("")
QueueHead = -1
QueueTail = -1
StoreItems()
Value = Dequeue()
if Value == False:
print("No data items")
else:
print("Item code", Value)
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.
e.g.
Java
try{
FileReader f = new FileReader(FileName);
try{
BufferedReader Reader = new BufferedReader(f);
String Line= Reader.readLine();
WordArray[NumberWords] = Line.replace("\n","");
NumberWords++;
Line = Reader.readLine();
Reader.close();
}catch(IOException ex){}
VB.NET
Try
Dim DataReader As StreamReader = New StreamReader(FileName)
NumberWords = 0
Do Until DataReader.EndOfStream
WordArray(NumberWords) = DataReader.ReadLine()
NumberWords = NumberWords + 1
Loop
DataReader.Close()
Catch ex As Exception
Console.WriteLine("Invalid file")
End Try
End Sub
Python
def ReadWords(FileName):
global WordArray
global NumberWords
File = open(FileName, 'r')
DataRead = File.read().strip()
File.close()
WordArray = DataRead.split()
NumberWords = len(WordArray)
e.g.
Java
VB.NET
ReadWords(FileName)
End Sub
Python
WordArray = []
NumberWords = 0
Choice = input("Easy, medium or hard? ").lower()
if Choice == "easy":
File = "Easy.txt"
elif Choice == "medium":
File = "Medium.txt"
else:
File = "Hard.txt"
ReadWords(File)
e.g.
Java
while(!(Answer.equals("no"))){
1(c)(i) QuantityFound++;
System.out.println("Correct, you have found " + QuantityFound + " words");
Found = true;
}
}
if(Found == false){
System.out.println("Sorry that was incorrect");
}
}
VB.NET
Sub Play()
Dim Word As String = WordArray(0)
Console.WriteLine("The word is: " & Word)
Console.WriteLine("There are " & NumberWords & " words that can be made with 3 or more
letters")
WordArray(0) = ""
Dim Contin As Boolean = True
Dim QuantityFound As Integer = 0
Dim Found As Boolean
Dim Answer As String = "yes"
While Answer <> "no"
Console.WriteLine("Enter your word or no to stop")
Answer = Console.ReadLine().ToLower()
Found = False
If Answer <> "Not" Then
For x = 0 To NumberWords
If Answer = WordArray(x) Then
Next x
If Found = False Then
Console.WriteLine("Sorry that was incorrect")
End If
End If
End While
End Sub
Python
def Play():
global WordArray
global NumberWords
Word = WordArray[0]
print("The word is: ", Word)
print("There are", NumberWords-1,"words that can be made with 3 or more letters")
WordArray[0] = ""
Answer = "yes"
QuantityFound = 0
while Answer != "no":
Answer = input("Enter your word or no to stop ").lower()
Found = False
WordArray[x] = ""
QuantityFound = QuantityFound + 1
print("Correct, you have found", QuantityFound, "words")
Found = True
if Found == False:
print("Sorry that was incorrect")
e.g.
Java
System.out.println("There are " + NumberWords + " words that can be made with 3 or
more letters");
WordArray[0] = "";
Boolean Contin = true;
Integer QuantityFound = 0;
String WordInput;
Boolean Found = false;
String Answer = "yes";
while(!(Answer.equals("no"))){
System.out.println("Enter your word or no to stop");
Answer = scanner.nextLine();
Found = false;
if(!(Answer.equals("no"))){
for(Integer x = 0; x <= NumberWords; x++){
if(Answer.equals(WordArray[x])){
WordArray[x] = "";
QuantityFound++;
System.out.println("Correct, you have found " + QuantityFound + "
words");
}
double Correct = ((Double.valueOf(QuantityFound) / Double.valueOf(NumberWords)) *
100.0);
System.out.println("You found " + Correct + "%");
if(WordArray[x] != ""){
System.out.println(WordArray[x]);
}
VB.NET
Sub Play()
Dim Word As String = WordArray(0)
Console.WriteLine("The word is: " & Word)
Console.WriteLine("There are " & NumberWords & " words that can be made with 3 or more
letters")
Found = False
If Answer <> "Not" Then
For x = 0 To NumberWords
If Answer = WordArray(x) Then
WordArray(x) = ""
QuantityFound = QuantityFound + 1
Console.WriteLine("Correct, you have found " & QuantityFound & " words")
Found = True
x = NumberWords + 1
End If
Next x
If Found = False Then
Console.WriteLine("Sorry that was incorrect") End If
End If
End While
1(c)(ii) Console.WriteLine(WordArray(x))
End If
Next x
End If
End Sub
Python
def Play():
global WordArray
global NumberWords
Word = WordArray[0]
print("The word is: ", Word)
print("There are", NumberWords-1,"words that can be made with 3 or more letters")
WordArray[0] = ""
Answer = "yes"
QuantityFound = 0
WordArray[x] = ""
QuantityFound = QuantityFound + 1
print("Correct, you have found", QuantityFound, "words")
Found = True
if Found == False:
print("Sorry that was incorrect")
Correct = (QuantityFound / (NumberWords-1)) * 100
print("You found", Correct,"%")
e.g.
Java
try{
FileReader f = new FileReader(FileName);
try{
WordArray[NumberWords] = Line.replace("\n","");
NumberWords++;
Line = Reader.readLine();
Reader.close();
Play();
}catch(IOException ex){}
}catch(FileNotFoundException e){
System.out.println("File not found");
}
}
1(d)(i) VB.NET
Try
Dim DataReader As StreamReader = New StreamReader(FileName)
NumberWords = 0
Do Until DataReader.EndOfStream
WordArray(NumberWords) = DataReader.ReadLine()
NumberWords = NumberWords + 1
Loop
DataReader.Close()
Play()
Catch ex As Exception
Console.WriteLine("Invalid file")
End Try
End Sub
Python
def ReadWords(FileName):
global WordArray
global NumberWords
File = open(FileName, 'r')
DataRead = File.read().strip()
File.close()
WordArray = DataRead.split()
NumberWords = len(WordArray)
Play()
1(d)(ii) 1 mark for screenshot showing the inputs "easy", "she", "out", "no" e.g. 1
1(d)(iii) 1 mark for screenshot showing the inputs ‘hard’, ‘fine’, ‘fined’, ‘idea’, ‘no’ e.g. 1
e.g.
Java
VB.NET
Class Node
Private LeftPointer As Integer
Private Data As Integer
Private RightPointer As Integer
Sub New(PData)
LeftPointer = -1
Data = PData
RightPointer = -1
End Sub
End Class
2(a)(i) Python
class Node():
def init (self, PData):
self. LeftPointer = -1 #int
self. Data = PData #int
self. RightPointer = -1 #int
e.g.
Java
VB.NET
Function GetLeft()
Return LeftPointer
End Function
Function GetRight()
Return RightPointer
End Function
Function GetData()
Return Data
End Function
Python
def GetLeft(self):
return self. LeftPointer
e.g.
Java
VB.NET
Sub SetLeft(NewLeft)
LeftPointer = NewLeft
End Sub
Sub SetRight(NewRight)
RightPointer = NewRight
End Sub
Sub SetData(NewData)
Data = NewData
End Sub
Python
e.g.
Java
class TreeClass{
public TreeClass(){
FirstNode = -1;
NumberNodes = 0;
Integer MinusOne = -1;
for(Integer x = 0; x < 20; x++){
Tree[x] = new Node(MinusOne);
}
}
}
VB.NET
Class TreeClass
Private Tree(20) As Node
Private FirstNode As Integer
Private NumberNodes As Integer
Sub New()
FirstNode = -1
NumberNodes = 0
2(b)(i) For x = 0 To 19
Tree(x) = New Node(-1)
Next
End Sub
End Class
Python
class TreeClass():
e.g.
Java
if(NumberNodes == 0){
Tree[0] = NewNode;
FirstNode = 0;
NumberNodes++;
}else{
Tree[NumberNodes] = NewNode;
NodeAccess = FirstNode;
Direction = "";
System.out.println(Tree[0].GetData());
while(NodeAccess != -1){
Previous = NodeAccess;
}
if(Direction.equals("left")){
Tree[Previous].SetLeft(NumberNodes);
}else{
Tree[Previous].SetRight(NumberNodes);
}
NumberNodes++;
}
}
VB.NET
Sub InsertNode(NewNode)
Dim NodeAccess As Integer
Dim Direction As String
Dim Previous As Integer
If NumberNodes = 0 Then
Tree(0) = NewNode
FirstNode = 0
NumberNodes += 1
Else
Tree(NumberNodes) = NewNode
NodeAccess = FirstNode
Direction = ""
Python
while(NodeAccess != -1):
Previous = NodeAccess
if NewNode.GetData() < self. Tree[NodeAccess].GetData():
if(Direction == "left"):
e.g.
Java
}
}
}
VB.NET
Sub OutputTree()
If NumberNodes = 0 Then
Console.WriteLine("No nodes")
Else
For x = 0 To NumberNodes - 1
Console.WriteLine(Tree(x).GetLeft() & " " & Tree(x).GetData() & " " &
Tree(x).GetRight())
Next
End If
End Sub
2(b)(iii) Python
def OutputTree(self):
if self. NumberNodes == 0:
print("No nodes")
else:
for x in range(0, self. NumberNodes):
print(self. Tree[x].GetLeft(), " ", self. Tree[x].GetData(), " ",self.
Tree[x].GetRight())
e.g.
Java
VB.NET
Python
TheTree = TreeClass()
e.g.
Java
public static void main(String args[]){
TreeClass TheTree = new TreeClass();
TheTree.InsertNode(new Node(10));
TheTree.InsertNode(new Node(11));
TheTree.InsertNode(new Node(5));
TheTree.InsertNode(new Node(1));
TheTree.InsertNode(new Node(20));
TheTree.InsertNode(new Node(7));
TheTree.InsertNode(new Node(15));
TheTree.OutputTree();
}
VB.NET
Sub Main(args As String())
Dim TheTree As TreeClass = New TreeClass()
TheTree.InsertNode(New Node(10))
TheTree.InsertNode(New Node(11))
TheTree.InsertNode(New Node(5))
TheTree.InsertNode(New Node(1))
TheTree.InsertNode(New Node(20))
TheTree.InsertNode(New Node(7))
TheTree.InsertNode(New Node(15))
TheTree.OutputTree()
End Sub
2(c)(ii) Python
TheTree = TreeClass()
TheTree.InsertNode(Node(10))
TheTree.InsertNode(Node(11))
TheTree.InsertNode(Node(5))
TheTree.InsertNode(Node(1))
TheTree.InsertNode(Node(20))
TheTree.InsertNode(Node(7))
TheTree.InsertNode(Node(15))
TheTree.OutputTree()
e.g.
Java
VB.NET
Python
e.g.
Java
public static Integer[] RecursiveInsertion(Integer[] IntegerArray, Integer NumberElements){
Integer LastItem;
Integer CheckItem;
while(LoopAgain){
IntegerArray[CheckItem + 1] = IntegerArray[CheckItem];
CheckItem = CheckItem - 1;
if(CheckItem < 0){
LoopAgain = false;
VB.NET
While LoopAgain
IntegerArray(CheckItem + 1) = IntegerArray(CheckItem)
CheckItem = CheckItem - 1
IntegerArray(CheckItem + 1) = LastItem
Return IntegerArray
End Function
Python
if NumberElements <= 1:
return IntegerArray
RecursiveInsertion(IntegerArray,NumberElements - 1)
LastItem = IntegerArray[NumberElements - 1]
CheckItem = NumberElements - 2
LoopAgain = True
if CheckItem < 0:
LoopAgain = False
elif IntegerArray[CheckItem] <= LastItem:
LoopAgain = False
while (LoopAgain):
IntegerArray[CheckItem + 1] = IntegerArray[CheckItem]
CheckItem = CheckItem - 1
if CheckItem < 0:
LoopAgain = False
elif IntegerArray[CheckItem] <= LastItem:
LoopAgain = False
e.g.
Java
VB.NET
SortedArray = RecursiveInsertion(NumberArray, 7)
Console.WriteLine("Recursive")
For x = 0 To 6
Console.WriteLine(SortedArray(x))
Next x
Python
e.g.
Java
while(LoopAgain){
IntegerArray[CheckItem + 1] = IntegerArray[CheckItem];
CheckItem = CheckItem - 1;
if(CheckItem < 0){
LoopAgain = false;
}else if(IntegerArray[CheckItem] <= LastItem){
LoopAgain = false;
}
}
VB.NET
Function IterativeInsertion(IntegerArray, NumberElements)
Dim LastItem, CheckItem As Integer
While NumberElements > 0
LastItem = IntegerArray(NumberElements - 1)
CheckItem = NumberElements - 2
Dim LoopAgain As Boolean = True
If CheckItem < 0 Then
LoopAgain = False
ElseIf IntegerArray(CheckItem) <= LastItem Then
LoopAgain = False
End If
While LoopAgain
IntegerArray(CheckItem + 1) = IntegerArray(CheckItem)
CheckItem = CheckItem - 1
If CheckItem < 0 Then
LoopAgain = False
ElseIf IntegerArray(CheckItem) <= LastItem Then
LoopAgain = False
End If
End While
IntegerArray(CheckItem + 1) = LastItem
NumberElements = NumberElements - 1
End While
Return IntegerArray
End Function
3(c)(i) Python
IntegerArray[CheckItem + 1] = LastItem
NumberElements = NumberElements - 1
return IntegerArray
e.g.
Java
VB.NET
Sorted2Array = IterativeInsertion(NumberArray, 7)
Console.WriteLine("iterative")
For x = 0 To 6
Console.WriteLine(Sorted2Array(x))
Next x
Python
Iterative
1 8 15 22 85 100 644
e.g.
Java
public static Integer BinarySearch(Integer[] IntegerArray, Integer First, Integer Last,
Integer ToFind){
Integer Middle;
if(First > Last){;
return -1;
}else{
Middle = (Last + First) / 2;
if(IntegerArray[Middle].equals(ToFind)){
return Middle;
}else if(IntegerArray[Middle] > ToFind){
return BinarySearch(IntegerArray, First, Middle - 1, ToFind);
}else{
return BinarySearch(IntegerArray, Middle + 1, Last, ToFind);
}
}
}
VB.NET
Function BinarySearch(IntegerArray, First, Last, ToFind)
Dim Middle As Integer
If First > Last Then
3(d)(i) Return -1
Else
Middle = (Last + First) \ 2
If IntegerArray(Middle) = ToFind Then
Return Middle
ElseIf IntegerArray(Middle) > ToFind Then
Return BinarySearch(IntegerArray, First, Middle - 1, ToFind)
Else
Return BinarySearch(IntegerArray, Middle + 1, Last, ToFind)
End If
End If
End Function
Python
if IntegerArray[Middle] == ToFind:
return Middle
else:
return BinarySearch(IntegerArray, Middle + 1, Last, ToFind)
e.g.
Java
VB.NET
Python
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.
VB.NET
Dim DataStored(19) As Integer
Dim NumberStored As Integer = 0
Python
global DataStored #integer
global NumberItems #Integer 20 items
VB.NET
Sub Initialise()
Console.WriteLine("How many numbers will you enter?")
Dim Quantity As Integer
Do
Quantity = Console.ReadLine()
Loop Until (Quantity > 0 And Quantity < 21)
For Count = 0 To Quantity - 1
Console.WriteLine("Enter number")
DataStored(NumberStored) = Console.ReadLine()
NumberStored += 1
Next
End Sub
1(b) Python
def Initialise():
global DataStored
global NumberItems
Valid = False
while(Valid == False):
NumberItems = int(input("How many numbers will you enter?")) #loop until < 20
if NumberItems > 0 and NumberItems< 21:
Valid = True
for Count in range(0, NumberItems):
DataStored.append(int(input("Enter number")))
VB.NET
NumberItems = 0
Initialise()
For X = 0 To NumberItems - 1
Console.WriteLine(DataStored(X))
Next
Python
NumberItems = 0
Initialise()
print(DataStored)
1(d)(i) Python
def BubbleSort():
global DataStored
global NumberItems
for Count in range(0, NumberItems):
for Count2 in range(0, NumberItems-1):
if DataStored[Count2] > DataStored[Count]:
DataStored[Count2], DataStored[Count] = DataStored[Count],
DataStored[Count2]
1(d)(ii) 1 mark for calling BubbleSort() and outputting array contents after 1
e.g.
VB.NET
BubbleSort()
For X = 0 To NumberStored - 1
Console.WriteLine(DataStored(X))
Next
e.g. Java
BubbleSort();
for(Integer X = 0; X < NumberItems; X++){
System.out.println(DataStored[X]);
}
e.g. Python
BubbleSort()
print(DataStored)
1(d)(iii) 1 mark for screenshot showing the inputs and the values in the correct order 1
e.g.
1(e)(i) VB.NET
Function BinarySearch(DataToFind)
Dim First As Integer = 0
Dim Last As Integer = NumberItems
Dim MidValue As Integer
While (First <= Last)
MidValue = (First + Last) / 2
If DataToFind = DataStored(MidValue) Then
Return MidValue
End If
If DataToFind < DataStored(MidValue) Then
Last = MidValue - 1
Else
First = MidValue + 1
End If
End While
Return -1
End Function
Python
def BinarySearch(DataToFind):
global DataStored
global NumberItems
First = 0
Last= NumberItems
while(First <= Last):
MidValue = int((First + Last) / 2)
if DataToFind == DataStored[MidValue]:
return MidValue
if DataToFind < DataStored[MidValue]:
Last = MidValue - 1
else:
First = MidValue + 1
return -1
VB.NET
Console.WriteLine("Enter a number to find")
Dim Search As Integer = Console.ReadLine()
Console.WriteLine(BinarySearch(Search))
Python
Search = int(input("Enter a number to find"))
print(BinarySearch(Search))
Test 2
public Tree(String Name, Integer HGrowth, Integer MaxH, Integer MaxW, String
PEvergreen){
TreeName = Name;
HeightGrowth = HGrowth;
MaxWidth = MaxW;
MaxHeight = MaxH;
Evergreen = PEvergreen;
}}
2(a)(i) VB.NET
Class Tree
Private TreeName As String
Private HeightGrowth As Integer
Private MaxHeight As Integer
Private MaxWidth As Integer
Private Evergreen As String
Sub New(Name, HGrowth, MaxH, MaxW, PEvergreen)
TreeName = Name
HeightGrowth = HGrowth
MaxHeight = MaxH
MaxWidth = MaxW
Evergreen = PEvergreen
End Sub
End Class
Python
class Tree:
def __init__(self, Name, HGrowth, MaxH, MaxW, PEvergreen):
self.__TreeName = Name
self.__HeightGrowth = HGrowth
self.__MaxHeight = MaxH
self.__MaxWidth = MaxW
self.__Evergreen = PEvergreen
2(a)(ii) VB.NET
Function GetTreeName()
Return TreeName
End Function
Function GetMaxHeight()
Return MaxHeight
End Function
Function GetMaxWIdth()
Return MaxWidth
End Function
Function GetGrowth()
Return HeightGrowth
End Function
Function GetEvergreen()
Return Evergreen
End Function
Python
def GetTreeName(self):
return self.__TreeName
def GetMaxHeight(self):
return self.__MaxHeight
def GetMaxWidth(self):
return self.__MaxWidth
def GetGrowth(self):
return self.__HeightGrowth
def GetEvergreen(self):
return self.__Evergreen
}catch(FileNotFoundException e){
System.out.println("File not found");
}
return TreeData;
}
2(b) VB.NET
Function ReadData()
Dim TreeObjects(10) As Tree
Dim TextFile As String = "Trees.txt"
try
Dim FileReader As New System.IO.StreamReader(TextFile)
Dim TreeData(10) As String
Dim TreeSplit() As String
For Count = 0 To 8
TreeData(Count) = FileReader.ReadLine()
Next Count
FileReader.Close()
For X = 0 To 8
TreeSplit = TreeData(X).Split(",")
TreeObjects(X) = New Tree(TreeSplit(0), Integer.Parse(TreeSplit(1)),
Integer.Parse(TreeSplit(2)), Integer.Parse(TreeSplit(3)), TreeSplit(4))
Next X
Catch ex As Exception
Console.WriteLine ("invalid file")
End Try
Return TreeObjects
End Function
2(b) Python
def ReadData():
TreeObjects=[]
try:
File = open("Trees.txt")
TreeData = []
TreeData = File.read().split("\n")
SplitTrees = []
for Item in TreeData:
SplitTrees.append(Item.split(","))
File.close()
for Item in SplitTrees:
TreeObjects.append(Tree(Item[0],int(Item[1]),int(Item[2]),int(Item[3]),Item[4]))
except IOError:
print ("invalid file")
return TreeObjects
e.g.
Java
public static void PrintTrees(Tree TreeItem){
String Final = "does not lose its leaves";
if((TreeItem.GetEvergreen()).compareTo("No") == 0){
Final = "loses its leaves each year";
}
System.out.println(TreeItem.GetTreeName() + " has a maximum height " +
TreeItem.GetMaxHeight() + " a maximum width " + TreeItem.GetMaxWidth() + " and grows " +
TreeItem.GetGrowth() + " cm a year. It " + Final);
}
VB.NET
Sub PrintTrees(Item)
Dim Final As String = "does not lose its leaves"
If (Item.GetEvergreen() = "No") Then
Final = "loses its leaves each year"
End If
Console.WriteLine(Item.GetTreeName() & " has a maximum height " &
Item.GetMaxHeight() & " a maximum width " & Item.GetMaxWidth() & " and grows " &
Item.GetGrowth() & "cm a year. It" & Final)
End Sub
2(c) Python
def PrintTrees(Item):
e.g.
Java
Tree[] TreeData = new Tree[20];
TreeData = ReadData();
PrintTrees(TreeData[0]);
VB.NET
Sub Main(args As String())
Dim TreeObjects(10) As Tree
TreeObjects = ReadData()
PrintTrees(Treeobjects(0))
End Sub
Python
TreeObjects = ReadData()
PrintTrees(TreeObjects[0])
e.g.
Java
public static void ChooseTree(Tree[] Trees){
Scanner scanner = new Scanner(System.in);
System.out.println("Do you want a tree that loses its leaves (enter lose), or keeps
its leaves (enter keep)") ;
String Evergreen = (scanner.nextLine());
System.out.println("What is the maximum tree height in cm");
Integer MaxHeight = Integer.parseInt(scanner.nextLine());
System.out.println("What is the maximum tree width in cm");
Integer MaxWidth = Integer.parseInt(scanner.nextLine());
Tree[] Options = new Tree[20];
String keep;
Tree Selected;
Boolean Valid = false;
if(((Evergreen.toLowerCase()).compareTo("keep") == 0) ||
((Evergreen.toLowerCase()).compareTo("keep leaves") == 0) ||
((Evergreen.toLowerCase()).compareTo("keeps its leaves") == 0)){
keep = "Yes";
}else{
keep = "No";
}
Integer Counter = 0;
for(Integer X = 0; X < 9; X++){
VB.NET
Sub ChooseTree(Trees)
Console.WriteLine("Do you want a tree that loses its leaves (enter lose), or keeps
its leaves (enter keep)")
Dim Evergreen As String = Console.ReadLine()
Console.WriteLine("What is the maximum tree height in cm")
Dim MaxHeight As Integer = Console.ReadLine()
Console.WriteLine("What is the maximum tree width in cm")
Dim MaxWidth As Integer = Console.ReadLine()
Dim Options(0 To 9) As Tree
Dim keep As String
Dim Valid As Boolean
Dim Selected As Tree
If Evergreen.ToLower() = "keep" Or Evergreen.ToLower() = "keep leaves" Or
Evergreen.ToLower() = "keeps its leaves" Then
keep = "Yes"
Else
keep = "No"
2(e)(i) End If
Dim count As Integer = 0
For x = 0 To 8
If Trees(x).GetMaxHeight() <= MaxHeight And Trees(x).GetMaxWidth() <= MaxWidth
And keep = Trees(x).GetEvergreen() Then
Options(count) = Trees(x)
PrintTrees(Trees(x))
count = count + 1
End If
Next x
If count = 0 Then
Console.WriteLine("No suitable trees")
End If
End Sub
Python
def ChooseTree(Trees):
Evergreen = input("Do you want a tree that loses its leaves (enter lose), or keeps its
leaves (enter keep)")
MaxHeight = int(input("What is the maximum tree height in cm"))
MaxWidth = int(input("What is the maximum tree width in cm"))
Options = []
if Evergreen.lower() == "keep" or Evergreen.lower() == "keep leaves" or
Evergreen.lower() == "keeps its leaves":
keep = "Yes"
else:
keep = "No"
for Item in Trees:
2(e)(ii) Java
Integer Start;
Float Height;
Float Growth;
Float Years;
while(Valid == false){
System.out.println("Enter the name of the tree you want");
String Choice = scanner.nextLine();
for(Integer X = 0; X < Counter; X++){
if((Options[X].GetTreeName()).compareTo(Choice)==0){
Valid = true;
Selected = Options[X];
System.out.println("Enter the height of the tree you would like to start
with in cm");
Start = Integer.parseInt(scanner.nextLine());
Height = (Selected.GetMaxHeight()).floatValue();
Growth = (Selected.GetGrowth()).floatValue();
Years = (Height - Start) / Growth;
System.out.println("Your tree should be full height in approximately "+
Years + " years");
}
}
}
Python:
Valid = False
while Valid == False:
Choice = input("Enter the name of the tree you want")
for Item in Options:
if Item.GetTreeName() == Choice:
Valid = True
Selected = Item
Start = int(input("Enter the height of the tree you would like to start with in
cm"))
Years = (Selected.GetMaxHeight() - Start)/Selected.GetGrowth()
print("Your tree should be full height in approximately", Years,"years")
Python
global QueueData
global QueueHead
global QueueTail
QueueData = []
for x in range(0, 20):
QueueData.append("")
QueueHead = -1
QueueTail = -1
3(b) Python
def Enqueue(DataToInsert):
global QueueData
global QueueHead
global QueueTail
if QueueTail == 19:
return False
elif QueueHead == -1:
QueueHead = 0
QueueTail = QueueTail + 1
QueueData.append(DataToInsert)
return True
3(c) Python
def Dequeue():
global QueueData
global QueueHead
global QueueTail
if QueueHead < 0 or QueueHead > 20 or QueueHead > QueueTail:
return False
else:
QueueHead = QueueHead + 1
return QueueData[QueueHead-1]
VB.NET
Sub StoreItems()
End Sub
3(d)(i) Python
def StoreItems():
global QueueData
global QueueHead
global QueueTail
Count = 0
for X in range(0, 10):
Data = input("Enter data")
Total= int(Data[0]) + int(Data[1]) * 3 + int(Data[2]) + int(Data[3]) * 3 +
int(Data[4]) + int(Data[5]) * 3
Total = int(Total / 10)
if((Total == 10 and Data[6] == "X") or (Total == int(Data[6]))):
Result = Enqueue(Data[0:6])
if(Result == True):
print("Inserted item")
else:
print("Queue full")
else:
Count = Count + 1
End Sub
3(d)(ii) Python
QueueData = []
for x in range(0, 20):
QueueData.append("")
QueueHead = -1
QueueTail = -1
StoreItems()
Value = Dequeue()
if Value == False:
print("No data items")
else:
print("Item code", Value)
1 hour 30 minutes
INSTRUCTIONS
● Answer all questions.
● Use a black or dark blue pen.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● You may use an HB pencil for any diagrams, graphs or rough working.
● Calculators must not be used in this paper.
INFORMATION
● The total mark for this paper is 75.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.
DC (DE/SG) 329372/2
© UCLES 2024 [Turn over
2
1 (a) Tick (✓) one box to identify the correct logic statement for this truth table.
A B C X
0 0 0 1
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 0
(A XOR B) NOR C
(A OR B OR C) NOR C
B X
[2]
2 A video doorbell is attached to the front door of a house. The doorbell uses a motion sensor to
detect when a visitor walks in front of the door. When the motion sensor is activated:
The doorbell also has a button that can be pressed. When the button is pressed, a message is
transmitted to a smartphone to play the doorbell sound.
The videos are stored on the doorbell’s internal secondary storage device and overwritten when
the secondary storage device is full.
1 ................................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
...................................................................................................................................................
[2]
(b) State whether the video doorbell is a monitoring system or a control system.
Justify your choice.
Justification ...............................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[2]
(c) The video doorbell has both primary memory and secondary storage.
(i) Identify two items of data that the video doorbell will store in primary memory.
1 ........................................................................................................................................
...........................................................................................................................................
2 ........................................................................................................................................
...........................................................................................................................................
[2]
(ii) The video doorbell has a solid state (flash) secondary storage device.
Complete the table by writing the answer or answers to each statement about the
principal operation of solid state (flash) memory.
Statement Answer
[4]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(d) The digital camera has a microphone which is used to record the sound for the video.
The user changes the sampling rate that the microphone uses from 44.1 kHz to 88.2 kHz.
Describe how this change in sampling rate will affect the performance of the video doorbell.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
(e) The video doorbell allows both real-time and on-demand bit streaming.
...........................................................................................................................................
..................................................................................................................................... [1]
(ii) Give two differences between real-time and on-demand bit streaming.
1 ........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
2 ........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[2]
(a) The developer uses an interpreter while writing the program code because it is easier for
debugging.
Explain one reason why it is easier to debug the program code using an interpreter instead of
a compiler.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
Explain the reasons why the need to create an executable file makes the complier the
appropriate choice when the program is complete.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
BLANK PAGE
4 The following table shows part of the instruction set for a processor. The processor has two
registers: the Accumulator (ACC) and an Index Register (IX).
Instruction
Explanation
Opcode Operand
LDM #n Immediate addressing. Load the number n to ACC
Direct addressing. Load the contents of the location at the given
LDD <address>
address to ACC
Indirect addressing. The address to be used is at the given address.
LDI <address>
Load the contents of this second address to ACC
Indexed addressing. Form the address from <address> + the contents
LDX <address> of the Index Register. Copy the contents of this calculated address to
ACC
LDR #n Immediate addressing. Load the number n to IX
ADD #n/Bn/&n Add the number n to the ACC
ADD <address> Add the contents of the given address to the ACC
SUB #n/Bn/&n Subtract the number n from the ACC
SUB <address> Subtract the contents of the given address from the ACC
INC <register> Add 1 to the contents of the register (ACC or IX)
<address> can be an absolute or a symbolic address
# denotes a denary number, e.g. #123
B denotes a binary number, e.g. B01001010
& denotes a hexadecimal number, e.g. &4A
Address Data
19 24
20 2
21 1
22 3
23 5
24 4
25 22
ACC 12
IX 1
Complete the table by writing the content of the ACC after each program has run.
LDD 20
1
ADD #2
2 LDX 22
LDI 25
3 INC ACC
SUB 22
LDD 19
4 LDM #5
LDM #25
[4]
Instruction
Explanation
Opcode Operand
AND #n/Bn/&n Bitwise AND operation of the contents of ACC with the operand
Bitwise AND operation of the contents of ACC with the contents of
AND <address>
<address>
XOR #n/Bn/&n Bitwise XOR operation of the contents of ACC with the operand
Bitwise XOR operation of the contents of ACC with the contents of
XOR <address>
<address>
OR #n/Bn/&n Bitwise OR operation of the contents of ACC with the operand
Bitwise OR operation of the contents of ACC with the contents of
OR <address>
<address>
<address> can be an absolute or a symbolic address
# denotes a denary number, e.g. #123
B denotes a binary number, e.g. B01001010
& denotes a hexadecimal number, e.g. &4A
Address Data
30 01110101
31 11111111
32 00000000
33 11001100
34 10101010
1 0 0 1 1 0 1 0
Complete the table by writing the content of the ACC after each program has run.
The binary number 10011010 is reloaded into the ACC before each program is run.
1 AND 31
2 XOR B01001111
3 OR #30
[3]
© UCLES 2024 9618/11/M/J/24
11
5 A bank allows customers to access their accounts using an application that they can download
onto a device such as a smartphone.
(a) The system that allows customers to access their accounts using the application is a
client-server model.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
(b) The bank wants to protect the integrity of its data while transferring the data to other banks.
Parity check is one example of data verification.
Complete the description of parity check when Computer A is transmitting data to Computer B.
and the group has an even number of 1s, a parity bit of 1 is appended, otherwise a parity bit
of 0 is appended.
example in a grid. The number of 1s in each column (bit position) is counted. A bit is assigned
to each column to make the column match the parity. These parity bits are transmitted with
(c) The bank also needs to keep its customers’ data private and secure.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [3]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [4]
6 A company is developing a website that will allow users to create an account and then play a quiz
every day. The data about the users and the quizzes are stored in a database.
A user must select a unique username and enter a valid email address to create an account. All
users must be over the age of 16. A new quiz is given to the users every day. Each quiz is stored
in its own text file.
The database stores the filename of each quiz and the date it can be played. The user gets a
score for each quiz they complete, which is stored in the database. The scores are used to give
each user a rating, for example Gold.
(a) Create a 3-table design for this database normalised to Third Normal Form (3NF).
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [6]
(b) The company is using a Database Management System (DBMS) to set up the database.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[4]
© UCLES 2024 9618/11/M/J/24 [Turn over
14
(c) The company has another database, FARMING, for a different game.
The database FARMING has a table named EVENT which is shown with some sample data.
(i) The database FARMING has a second table created named PLAYER that has the primary
key PlayerID.
The field PlayerID in EVENT needs to be set up as a foreign key to link to PlayerID in
PLAYER.
Write a Structured Query Language (SQL) script to change the table definition for EVENT
to link the foreign key to PLAYER.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(ii) Write an SQL script to return the number of events that each player has completed.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [3]
10011110
01100001
+00011001
[3]
Tick (✓) one or more boxes in each row to identify the topology, or topologies, each statement
describes.
[5]
(b) The LAN will connect to the internet through a router. The router has a public IPv6 address.
...........................................................................................................................................
..................................................................................................................................... [1]
(ii) One difference between an IPv4 and IPv6 address is that the numbers in an IPv4 address
are separated by full stops and in an IPv6 address they are separated by colons.
1 ........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
2 ........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[2]
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge
Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.
1 hour 30 minutes
INSTRUCTIONS
● Answer all questions.
● Use a black or dark blue pen.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● You may use an HB pencil for any diagrams, graphs or rough working.
● Calculators must not be used in this paper.
INFORMATION
● The total mark for this paper is 75.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.
DC (CE/SG) 329373/3
© UCLES 2024 [Turn over
2
NAND .......................................................................................................................................
...................................................................................................................................................
NOR ..........................................................................................................................................
...................................................................................................................................................
XOR ..........................................................................................................................................
...................................................................................................................................................
OR ............................................................................................................................................
...................................................................................................................................................
[4]
[2]
2 A computer game is being designed that users will be able to play using a virtual reality (VR)
headset.
A headset can have one or two .......................................................... that output the image to
the user. The headset has speakers that output surround sound to give a realistic experience.
(b) The computer uses a buffer when transmitting data to the VR headset.
Explain how a buffer is used when data is transmitted between the computer and the VR
headset.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
(c) The VR headset has Electrically Erasable Programmable Read Only Memory (EEPROM).
Explain the benefits of using EEPROM instead of other types of Read Only Memory (ROM) in
the VR headset.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
(d) The computer can transmit a video made from bitmap images and vector graphic animations
to the VR headset.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [3]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(iii) The bitmap video is not compressed before transmission to the VR headset.
Give two reasons why the video does not need to be compressed.
1 ........................................................................................................................................
...........................................................................................................................................
2 ........................................................................................................................................
...........................................................................................................................................
[2]
3 An assessment board scans exam papers and stores the digitised papers on a server. Exam
markers download the digitised papers to mark. The exam markers then upload the mark for each
paper.
(a) The assessment board needs to make sure the data stored on the server is secure.
(i) Authentication methods can help to protect the server against hackers.
Identify one other security measure that helps to protect the server from hackers.
Description ........................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[3]
(ii) Identify one security measure that helps to protect the data when it is being transmitted
to its destination. Describe how the security measure works.
Description ........................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[3]
(b) The exam markers use software that operates as a thin-client to mark the exam papers.
1
............................................................. ........................................................................
............................................................. ........................................................................
............................................................. ........................................................................
............................................................. ........................................................................
2
............................................................. ........................................................................
............................................................. ........................................................................
............................................................. ........................................................................
............................................................. ........................................................................
[4]
(c) Data transmitted on the internet passes through multiple different systems.
(i) Describe the role of routers in the transmission of data through the internet.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(ii) Describe the role of the PSTN (Public Switched Telephone Network) in the transmission
of data through the internet.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
4 An assessment board wants to store the marks students achieved in exams in a database named
RECORDS.
...................................................................................................................................................
............................................................................................................................................. [1]
Write a Structured Query Language (SQL) script to define the table EXAM.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
(c) The table EXAM_QUESTION has been created but the foreign key has not been linked.
Write an SQL script to update EXAM_QUESTION and link the foreign key to EXAM.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(d) The database also needs to store data about the students, the exams the students have
taken and the marks the students achieved in each question of each exam.
Describe the additional tables that will need to be included in the database and explain how
all the tables in the database will be linked.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [5]
BLANK PAGE
5 The following table shows part of the instruction set for a processor. The processor has two
registers: the Accumulator (ACC) and an Index Register (IX).
Instruction
Explanation
Opcode Operand
LDM #n Immediate addressing. Load the number n to ACC
Direct addressing. Load the contents of the location at the given
LDD <address>
address to ACC
Indirect addressing. The address to be used is at the given address.
LDI <address>
Load the contents of this second address to ACC
Indexed addressing. Form the address from <address> + the contents
LDX <address> of the index register. Copy the contents of this calculated address to
ACC
LDR #n Immediate addressing. Load the number n to IX
ADD #n/Bn/&n Add the number n to the ACC
ADD <address> Add the contents of the given address to the ACC
SUB #n/Bn/&n Subtract the number n from the ACC
SUB <address> Subtract the contents of the given address from the ACC
INC <register> Add 1 to the contents of the register (ACC or IX)
<address> can be an absolute or a symbolic address
# denotes a denary number, e.g. #123
B denotes a binary number, e.g. B01001010
& denotes a hexadecimal number, e.g. &4A
Address Data
10 1
11 3
12 5
13 11
14 10
15 16
16 12
ACC 10
IX 0
Complete the table by writing the content of the ACC after each program has run.
LDI 15
1
SUB #1
LDD 14
2
ADD 11
LDM #11
3 ADD #3
SUB 16
LDR #2
4 LDX 14
ADD #2
[4]
Instruction
Explanation
Opcode Operand
AND #n/Bn/&n Bitwise AND operation of the contents of ACC with the operand
Bitwise AND operation of the contents of ACC with the contents of
AND <address>
<address>
XOR #n/Bn/&n Bitwise XOR operation of the contents of ACC with the operand
Bitwise XOR operation of the contents of ACC with the contents of
XOR <address>
<address>
OR #n/Bn/&n Bitwise OR operation of the contents of ACC with the operand
Bitwise OR operation of the contents of ACC with the contents of
OR <address>
<address>
<address> can be an absolute or a symbolic address
# denotes a denary number, e.g. #123
B denotes a binary number, e.g. B01001010
& denotes a hexadecimal number, e.g. &4A
Address Data
25 11000110
26 11100001
27 10000001
28 11001101
29 00001111
0 1 0 0 0 1 1 0
Complete the table by writing the content of the ACC after each program has run.
The binary number 01000110 is reloaded into the ACC before each program is run.
1 XOR 29
2 AND #29
3 OR B11111111
[3]
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
.................................................................................................................................................... [4]
(a) Tick (3) one box only to identify the largest file size.
3300 kibibytes
0.3 megabytes
3 mebibytes
3300 kilobytes
[1]
(b) Subtract the denary number 10 from the denary number 100 using binary subtraction.
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Answer ....................................
[3]
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Answer ....................................
[2]
(a) The programmer decides to use the compiler when testing the final program.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
Complete the table by identifying one other common IDE feature that can be used for each
purpose. Describe how each feature helps the user during program development.
Each feature must be different. Do not give translator as one of your features.
..................................................................................
..................................................................................
..................................
for
coding ..................................................................................
..................................
..................................................................................
..................................................................................
..................................................................................
..................................
for
presentation ..................................................................................
..................................
..................................................................................
..................................................................................
..................................................................................
..................................
for
debugging ..................................................................................
..................................
..................................................................................
[6]
(c) The programmer uses program libraries when developing the program.
1 ................................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
...................................................................................................................................................
[2]
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge
Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.
¬O. 3mIsWEªQf W
¬a=§h8Y~9]ndf
¥UUU5¥u 5 EE uU
* 4 9 7 7 2 5 9 3 4 5 *
1 hour 30 minutes
INSTRUCTIONS
● Answer all questions.
● Use a black or dark blue pen.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● You may use an HB pencil for any diagrams, graphs or rough working.
● Calculators must not be used in this paper.
INFORMATION
● The total mark for this paper is 75.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.
DC (KS/SG) 329374/2
© UCLES 2024 [Turn over
* 0019655335902 *
as ................................................ bytes.
as ................................................ gigabytes.
[4]
...................................................................................................................................................
............................................................................................................................................. [1]
...................................................................................................................................................
............................................................................................................................................. [1]
(i) Complete the table by identifying the number of bits each of the character sets allocates
to each character.
ASCII
extended ASCII
Unicode
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
DO NOT WRITE IN THIS MARGIN
ĬÍĊ®Ġ³íÉó×ęÅĪÔċèĞ×
© UCLES 2024 ĬĚĘâÀģäÒâïüÖĕġ¾ĜÞĂ
ĥąÅÕõõåĕåÅĥÕąąåÅÕÕ
9618/13/M/J/24
* 0019655335903 *
DO NOT WRITE IN THIS MARGIN
3
, ,
(a) The photograph has a resolution of 4000 pixels wide by 3000 pixels high. The bit depth is
4 bytes.
Working .....................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
...................................................................................................................................................
(i) Give three benefits of this photograph being compressed using lossy compression
instead of lossless compression.
DO NOT WRITE IN THIS MARGIN
1 ........................................................................................................................................
...........................................................................................................................................
2 ........................................................................................................................................
...........................................................................................................................................
3 ........................................................................................................................................
...........................................................................................................................................
[3]
DO NOT WRITE IN THIS MARGIN
(ii) Explain how run-length encoding (RLE) will compress the photograph.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(c) Identify two elements of a bitmap image that can be changed to reduce its file size.
1 ................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
2 ................................................................................................................................................
...................................................................................................................................................
[2]
ĬÏĊ®Ġ³íÉó×ęÅĪÔĉèĞ×
© UCLES 2024 ĬĚėáÈĥàâ×ĉąēÁęĚĜÎĂ
ĥąµĕµĕÅõµµµÕąĥÅąÅÕ
9618/13/M/J/24 [Turn over
* 0019655335904 *
3 The following table shows part of the instruction set for a processor. The processor has two
registers: the Accumulator (ACC) and an Index Register (IX).
Instruction
Explanation
Opcode Operand
LDM #n Immediate addressing. Load the number n to ACC
ADD <address> Add the contents of the given address to the ACC
DEC <register> Subtract 1 from the contents of the register (ACC or IX)
SUB <address> Subtract the contents of the given address from the ACC
ĬÍĊ®Ġ³íÉó×ęÅĪÒċèĠ×
© UCLES 2024 ĬĚėäÈğÎçäćþĜ쵼ȿĂ
ĥµĥĕõĕÅÕÕĕÅÕÅĥĥąÕÕ
9618/13/M/J/24
* 0019655335905 *
DO NOT WRITE IN THIS MARGIN
5
, ,
Address Data
48 51
49 6
50 48
51 50
DO NOT WRITE IN THIS MARGIN
52 49
53 50
54 6
ACC 2
IX 50
Complete the table by writing the content of the ACC after each program has run.
DO NOT WRITE IN THIS MARGIN
LDM #50
1 INC ACC
SUB #1
LDI 51
2
ADD 52
LDR #2
DO NOT WRITE IN THIS MARGIN
LDX 50
3
DEC ACC
LDD 52
4 SUB 54
INC ACC
[4]
DO NOT WRITE IN THIS MARGIN
ĬÏĊ®Ġ³íÉó×ęÅĪÒĉèĠ×
© UCLES 2024 ĬĚĘãÀĩÒ×ÕñóÍ·½ĠČÖĂ
ĥµĕÕµõåµÅĥĕÕÅąąÅÅÕ
9618/13/M/J/24 [Turn over
* 0019655335906 *
Instruction
Explanation
Opcode Operand
AND #n/Bn/&n Bitwise AND operation of the contents of ACC with the operand
Bitwise AND operation of the contents of ACC with the contents of
AND <address>
<address>
XOR #n/Bn/&n Bitwise XOR operation of the contents of ACC with the operand
Address Data
100 00001101
101 10111110
1 1 1 1 1 1 1 1
DO NOT WRITE IN THIS MARGIN
ĬÑĊ®Ġ³íÉó×ęÅĪÓĉåĞ×
© UCLES 2024 ĬĚėãÃģºÍÍöĂè×µýäæĂ
ĥĥµÕµÕåĕąąµÕąąåąĕÕ
9618/13/M/J/24
* 0019655335907 *
DO NOT WRITE IN THIS MARGIN
7
, ,
Complete the table by writing the content of the ACC after each instruction has run.
The binary number 11111111 is reloaded into the ACC before each instruction is run.
1 LSL #2
2 XOR 100
DO NOT WRITE IN THIS MARGIN
3 AND 103
[3]
DO NOT WRITE IN THIS MARGIN
DO NOT WRITE IN THIS MARGIN
DO NOT WRITE IN THIS MARGIN
ĬÓĊ®Ġ³íÉó×ęÅĪÓċåĞ×
© UCLES 2024 ĬĚĘäËĥ¶ÝìĄïġă½ÙäÖĂ
ĥĥÅĕõµÅõĕõĥÕąĥÅÅąÕ
9618/13/M/J/24 [Turn over
* 0019655335908 *
4 A theatre wants to use a database to store data about the shows that are scheduled, their
customers and the seats that the customers have booked.
In the theatre:
(a) Identify the relationship between the tables PERFORMANCE and SHOW.
...................................................................................................................................................
............................................................................................................................................. [1]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
ĬÑĊ®Ġ³íÉó×ęÅĪÑĉåĠ×
© UCLES 2024 ĬĚĘáËğÈìÏþøĪáġû´ÞĂ
ĥÕĕĕµµÅÕõÕĕÕÅĥĥÅĕÕ
9618/13/M/J/24
* 0019655336009 *
DO NOT WRITE IN THIS MARGIN
9
, ,
(c) Write an SQL script to return the number of times each show is scheduled. For example, in
the sample data in part (b), the show MK12 is scheduled three times.
The result needs to include the show name and a suitable field name for the number of times
it is scheduled.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
(d) Customers give their first name, last name and email address when they are making a
DO NOT WRITE IN THIS MARGIN
Describe the additional tables that will need to be included in the database and explain how
these tables will be linked within the database.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [5]
DO NOT WRITE IN THIS MARGIN
ĬÓĉ¯Ġ³íÉó×ęÅĪÒĉåĠ×
© UCLES 2024 ĬĚĘãÈĤ·¾àÿČÍĚáûĄÖĂ
ĥĥµÕµĕĥµĕÕµÕąåĥąåÕ
9618/13/M/J/24 [Turn over
* 0019655336010 *
5 A multimedia design company has an office with a LAN (local area network). The LAN can have
up to 20 devices connected with cables and other devices connected using wireless access.
(a) The company has private cloud storage for its employees to store their work.
...........................................................................................................................................
..................................................................................................................................... [1]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
(b) Part of the internal structure of the wired LAN is a star topology.
Explain how packets are transmitted between two devices in a star topology.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
ĬÑĉ¯Ġ³íÉó×ęÅĪÓċçĞ×
© UCLES 2024 ĬĚĖäÅĨ³ì×òî²âÛ˼ÎĂ
ĥµåÕõõåÕåĕĥĕąĥąÅąÕ
9618/13/M/J/24
* 0019655336011 *
DO NOT WRITE IN THIS MARGIN
11
, ,
Describe how the collision is managed using Carrier Sense Multiple Access/Collision
Detection (CSMA/CD).
...........................................................................................................................................
...........................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...........................................................................................................................................
..................................................................................................................................... [2]
1 ........................................................................................................................................
...........................................................................................................................................
2 ........................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...........................................................................................................................................
[2]
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [1]
DO NOT WRITE IN THIS MARGIN
DO NOT WRITE IN THIS MARGIN
ĬÓĉ¯Ġ³íÉó×ęÅĪÓĉçĞ×
© UCLES 2024 ĬĚĕã½Ģ¯ÜâĈă÷öãď¼ÞĂ
ĥµÕĕµĕŵµĥµĕąąĥąĕÕ
9618/13/M/J/24 [Turn over
* 0019655336012 *
6 Each of the following truth tables has three inputs (A, B and C) and one output (X).
Draw one line to match each truth table with its logic expression.
A B C X
0 0 0 0 NOT (A XOR B) AND C
0 0 1 1
A B C X
0 0 0 0
1 1 1 1
[3]
ĬÑĉ¯Ġ³íÉó×ęÅĪÑċçĠ×
© UCLES 2024 ĬĚĕâ½Ĭ½ÍÕĊČðØÿìÖĂ
ĥąąĕõĕÅĕÕÅÅĕÅąÅąąÕ
9618/13/M/J/24
* 0019655336013 *
DO NOT WRITE IN THIS MARGIN
13
, ,
Complete the table by identifying two sensors that can be included in the robot and the
purpose of each sensor in the navigation system.
DO NOT WRITE IN THIS MARGIN
.............................................. ..........................................................................................
.............................................. ..........................................................................................
.............................................. ..........................................................................................
.............................................. ..........................................................................................
[2]
DO NOT WRITE IN THIS MARGIN
(b) The robot uses Artificial Intelligence (AI) to communicate with the customers. The customers
speak to the robot to order their food and drinks.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
ĬÓĉ¯Ġ³íÉó×ęÅĪÑĉçĠ×
© UCLES 2024 ĬĚĖáÅĞÁÝäðõ¹Ą÷ĩìæĂ
ĥąõÕµõåõŵĕĕÅĥåÅĕÕ
9618/13/M/J/24 [Turn over
* 0019655336014 *
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
ĬÍĉ¯Ġ³íÉó×ęÅĪÒĊæĢ×
© UCLES 2024 ĬĚĕãÈĤ®ÕÒúòĖàÞĝĜÞĂ
ĥåõĕõĕĥÕååĕÕąåąąÅÕ
9618/13/M/J/24
* 0019655336015 *
DO NOT WRITE IN THIS MARGIN
15
, ,
(e) Program libraries were used when writing the robot’s software.
...........................................................................................................................................
..................................................................................................................................... [1]
(ii) Some program libraries include Dynamic Link Library (DLL) files.
Describe the benefits of a programmer using a library with DLL files instead of using a
DO NOT WRITE IN THIS MARGIN
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [4]
DO NOT WRITE IN THIS MARGIN
DO NOT WRITE IN THIS MARGIN
ĬÏĉ¯Ġ³íÉó×ęÅĪÒČæĢ×
© UCLES 2024 ĬĚĖäÀĦ²åçĀÿÓüÖ¹ĜÎĂ
ĥåąÕµõąµµÕÅÕąÅĥÅÕÕ
9618/13/M/J/24 [Turn over
* 0019655336016 *
(f) The data from the robots is transmitted to a central computer using a wireless connection.
(i) Complete the table by identifying and describing two methods of data verification that
can be used during data transfer.
Method Description
1
..........................................................................................
......................................... ..........................................................................................
..........................................................................................
..........................................................................................
..........................................................................................
2
..........................................................................................
......................................... ..........................................................................................
..........................................................................................
..........................................................................................
..........................................................................................
[4]
(ii) Explain how encryption can protect the security of data during transmission.
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
DO NOT WRITE IN THIS MARGIN
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge
Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.
ĬÍĉ¯Ġ³íÉó×ęÅĪÔĊæĤ×
© UCLES 2024 ĬĚĖáÀĠÄäÔĂĈÜÚúěČæĂ
ĥĕÕÕõõąĕÕõµÕÅÅÅÅÅÕ
9618/13/M/J/24
Cambridge International AS & A Level
* 8 4 1 6 1 0 0 9 4 2 *
2 hours
INSTRUCTIONS
● Answer all questions.
● Use a black or dark blue pen.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● You may use an HB pencil for any diagrams, graphs or rough working.
● Calculators must not be used in this paper.
INFORMATION
● The total mark for this paper is 75.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.
● The insert contains all the resources referred to in the questions.
DC (PQ/CGW) 329348/4
© UCLES 2024 [Turn over
2
Refer to the insert for the list of pseudocode functions and operators.
(a) The following table shows four valid pseudocode assignment statements.
Complete the table by giving an appropriate data type to declare each of the variables A, B, C
and D.
Variable Value
Sorted False
Tries 9
ID "ZGAC001"
Complete the table by evaluating each expression, using the example values.
Expression Evaluates to
Tries MOD 4
TO_LOWER(MID(ID, 3, 1))
(c) The variable names A, B, C and D in part (a) are not good programming practice.
...........................................................................................................................................
..................................................................................................................................... [1]
(ii) Identify one problem that these variable names might cause.
...........................................................................................................................................
..................................................................................................................................... [1]
(iii) The choice of suitable variable names is one example of good programming practice.
...........................................................................................................................................
..................................................................................................................................... [1]
START
INPUT A, B
Yes
No
END
[5]
© UCLES 2024 9618/21/M/J/24
5
Following the input of ThisSequence the revised algorithm will extract the pairs of numbers.
Describe the variable ThisSequence and how the numbers are extracted.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
3 The diagram shows an Abstract Data Type (ADT) representation of a linked list after data items
have been added.
PS
Df Dc Db Dy Ø
PF
Fg Fh Fm Fw Ø
(a) Describe the linked list immediately after initialisation, before any data items are added.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
(b) A program will be written to include a linked list to store alphanumeric user IDs.
The design uses two variables and two 1D arrays to implement the linked list.
Each array element contains data of a single data type and not a record.
................................................................................................................................................. .
• total the element values in odd index locations (1, 3, 5 ... 97, 99)
• total the element values in even index locations (2, 4, 6 ... 98, 100)
• return one of three strings ‘Odd’, ‘Even’ or ‘Same’ to indicate which total is the greater, or
whether the totals are the same.
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
.................................................................................................................................................... [6]
BLANK PAGE
5 A global 1D array of strings contains three elements which are assigned values as shown:
Data[1] "aaaaaa"
Data[2] "bbbbbb"
Data[3] "cccccc"
Result "****"
CASE OF C
'X' : Result TO_UPPER(Data[Index])
'Y' : Result TO_LOWER(Data[Index])
'Z' : Result "**" & Data[Index]
ENDCASE
Data[Index] LEFT(Result, L)
NEXT Count
ENDPROCEDURE
(a) Complete the trace table by dry running the procedure when it is called as follows:
CALL Process("X3Y2W4")
[6]
(b) The procedure is to be modified. If variable C is assigned a value other than 'X', 'Y' or 'Z',
then procedure Error() is called and passed the value of variable C as a parameter.
..................................................................................................................................... [1]
..................................................................................................................................... [1]
6 Three points on a grid form a triangle with sides of length A, B and C as shown in the example:
10
9
8
7
6
5 B C
4
3
2 A
1
x
0 1 2 3 4 5 6 7 8 9 10
A triangle is said to be right-angled if the following test is true (where A is the length of the longest
side):
A2 = B2 + C2
You can calculate A2, B2 and C2 by using the coordinates of the endpoints of each line.
10
9
8
7
P2
6 (x2, y2)
5 B
4
3
P1
2 (x1, y1)
1
x
0 1 2 3 4 5 6 7 8 9 10
The endpoints, P1 and P2, have the coordinates (3, 2) and (6, 6).
In this example:
B2 = (3 − 6)2 + (2 − 6)2
B2 = (–3)2 + (–4)2
B2 = 9 + 16
B2 = 25
• take three sets of integers as parameters representing the coordinates of the three
endpoints that form a triangle
• return TRUE if the endpoints form a right-angled triangle, otherwise return FALSE.
In pseudocode, the operator ‘^’ represents an exponent, which is the number of times a value
is multiplied by itself. For example, the expression Value2 may be written in pseudocode as
Value ^ 2
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
ENDFUNCTION
[6]
(b) The test used to check if a triangle is right-angled can be written in two ways:
A2 = B2 + C2
or
A = √(B2 + C2)
The symbol √ represents the square root operation. For example, √81 = 9
A new function SQRT() is written to perform the square root operation. The function takes an
integer number as a parameter and returns a positive real value representing the square root
of the number.
During testing it is found that the SQRT() function returns a value that is only accurate to
4 decimal places.
For example, SQRT(25) returns 5.0000125 rather than the correct value of 5.0
The function IsRA() from part (a) is modified to use the new SQRT() function to test if a
triangle is right-angled.
Describe a problem that might occur when using the modified IsRA() function and suggest
a solution that still allows the SQRT() function to be used.
Problem ....................................................................................................................................
...................................................................................................................................................
Solution .....................................................................................................................................
...................................................................................................................................................
[2]
BLANK PAGE
7 A fitness club has a computerised membership system. The fitness club offers a number of
different exercise classes.
The following information is stored for each club member: name, home address, email address,
mobile phone number, date of birth and the exercise(s) they are interested in.
(a) When an exercise class is planned, a new module will send personalised text messages to
each member who has expressed an interest in that exercise. Members wishing to join the
class send a text message back. Members may decide not to receive future text messages
by replying with the message ‘STOP’.
...........................................................................................................................................
..................................................................................................................................... [1]
(ii) Identify three items of information that will be required by the new module.
Justify your choices with reference to the given scenario.
Justification .......................................................................................................................
...........................................................................................................................................
Justification .......................................................................................................................
...........................................................................................................................................
Justification .......................................................................................................................
...........................................................................................................................................
[3]
(iii) Identify two operations that would be required to process data when the new module
receives a text message back from a member.
Operation 1 .......................................................................................................................
...........................................................................................................................................
Operation 2 .......................................................................................................................
...........................................................................................................................................
[2]
Update
A
P2
T1
Name P1
(i) Explain the meaning of the diamond symbol (labelled with the letter A) in the chart.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(ii) Write the pseudocode module headers for Sub-A and Sub-B.
Sub-A
...........................................................................................................................................
...........................................................................................................................................
Sub-B
...........................................................................................................................................
...........................................................................................................................................
[4]
The process is split into a number of stages. Each stage performs a different task and creates a
new file named as shown:
Module Description
DeleteComment() • called with a parameter of type string representing a line of
pseudocode from a student’s project file
• returns the line after removing any comments
Note on comments:
A comment starts with two forward slash characters and includes all the
remaining characters on the line.
The following example shows a string before and after the comment has
been removed:
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
ENDFUNCTION
[8]
Module Description
Stage_1() • called with a parameter of type string representing a student name
• creates a new stage 1 file
• copies each line from the student’s project file to the stage 1 file after
removing any comment from each line
• does not write blank lines to the stage 1 file
• returns the number of lines written to the stage 1 file
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
© UCLES 2024 9618/21/M/J/24
21
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [7]
BLANK PAGE
BLANK PAGE
BLANK PAGE
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge
Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.
2 hours
INSTRUCTIONS
● Answer all questions.
● Use a black or dark blue pen.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● You may use an HB pencil for any diagrams, graphs or rough working.
● Calculators must not be used in this paper.
INFORMATION
● The total mark for this paper is 75.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.
● The insert contains all the resources referred to in the questions.
DC (PQ/CGW) 329350/3
© UCLES 2024 [Turn over
2
Refer to the insert for the list of pseudocode functions and operators.
Each example may contain statements that relate to one or more of the following:
• selection
• iteration (repetition)
• input/output.
Complete the table by placing one or more ticks (3) in each row.
MyChar CHAR
MyString STRING
MyInt INTEGER
Complete the table by filling in each gap with a function (from the insert) so that each expression
is valid.
Expression
(c) The variables given in part (b) are chosen during the design stage of the program development
life cycle.
State a suitable way of documenting the variables and give one piece of information that
should be recorded, in addition to the data type.
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
Assume the values are all different and are input in no particular order.
START
No
Yes
END
[5]
(b) A different part of the program contains an algorithm represented by the following program
flowchart:
START
Is Flag = Yes
TRUE ?
No END
Set Port to 1
No
Is Port = 4 ?
CALL Reset(Port)
Yes
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [5]
© UCLES 2024 9618/22/M/J/24
7
The data for each item will be held in a record structure of type Component.
The programmer has started to define the fields that will be needed as shown in the table.
(a) (i) Write pseudocode to declare the record structure for type Component.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [4]
(ii) A 1D array Item of 2000 elements will store the data for all items.
...........................................................................................................................................
..................................................................................................................................... [2]
(b) State three benefits of using an array of records to store the data for all items.
1 ................................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
...................................................................................................................................................
3 ................................................................................................................................................
...................................................................................................................................................
[3]
© UCLES 2024 9618/22/M/J/24 [Turn over
8
B C
A × A = (B × B) + (C × C)
A procedure will be written to check whether three lengths represent a right‑angled triangle.
The lengths will be input in any sequence.
The length of the longest side may not be the first value input.
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
.................................................................................................................................................... [5]
The program contains a global 1D array Data of type string containing 200 elements.
(a) (i) The pseudocode contains two syntax errors and one other error.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[3]
Statement ..........................................................................................................................
Explanation .......................................................................................................................
...........................................................................................................................................
[2]
(b) After correcting all syntax errors, the pseudocode is translated into program code which
compiles without generating any errors.
............................................................................................................................................. [1]
6 A music player stores music in a digital form and has a display which shows the track being
played.
(a) Up to 16 characters can be displayed. Track titles longer than 16 characters will need to be
trimmed as follows:
• Words must be removed from the end of the track title until the resulting title is less than
14 characters.
• When a word is removed, the space in front of that word is also removed.
• Three dots are added to the end of the last word displayed when one or more words
have been removed.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Bohemian Symphony B o h e m i a n . . .
Paperbook Writer P a p e r b o o k W r i t e r
Assume:
• Words in the original title are separated by a single space character.
• There are no spaces before the first word or after the last word of the original title.
• The first word of the original title is less than 14 characters.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [7]
The samples are to be stored in a text file. Each sample is converted to a numeric string and
32 samples are concatenated (joined) to form a single line of the text file.
Each numeric string is 8 characters in length; leading ‘0’ characters are added as required.
Example:
32 673 "00000673"
The example samples will be stored in the text file as a single line:
"000004560000004800037652...00000673"
(i) Identify one drawback of adding leading ‘0’ characters to each numeric string.
...........................................................................................................................................
..................................................................................................................................... [1]
(ii) Suggest an alternative method of storing the samples which does not involve adding
leading ‘0’ characters but which would still allow each individual sample to be extracted.
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [1]
(iii) State one drawback of the alternative method given in part (b)(ii).
...........................................................................................................................................
..................................................................................................................................... [1]
BLANK PAGE
The system stores information for each club member: name, home address, email address, mobile
phone number, date of birth and exercise preferences.
Many classes are full, and the club creates a waiting list for each class. The club adds details of
members who want to join a class that is full to the waiting list for that class.
When the system identifies that a space is available in one of the classes, a new module will send
a text message to each member who is on the waiting list.
(a) Decomposition will be used to break the new module into sub‑modules (sub‑problems).
Identify three sub‑modules that could be used in the design and describe their use.
Sub‑module 1 ...........................................................................................................................
Use ...........................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Sub‑module 2 ...........................................................................................................................
Use ...........................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Sub‑module 3 ...........................................................................................................................
Use ...........................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[3]
(b) A different part of the program is represented by the following state‑transition diagram.
Input-B | Output-W
Input-B
Input-B
START
S1 S3 S2 S5
Input-A
Input-A Input-A | Output-W
Input-B | Output-Y
Input-A | Output-X
S4
(i) Complete the table to show the inputs, outputs and next states.
Assume that the current state for each row is given by the ‘Next state’ on the previous
row. For example, the first Input‑A is made when in state S1.
If there is no output for a given transition, then the output cell should contain ‘none’.
S1
Input‑A none S3
Output‑W
none
Input‑B
Input‑A
S4
[5]
(ii) Identify the input sequence that will cause the minimum number of state changes in the
transition from S1 to S4.
..................................................................................................................................... [1]
The process is split into a number of stages. Each stage performs a different task and creates a
new file.
For example:
(a) Suggest a reason why the teacher’s program has been split into a number of stages and give
the benefit of producing a different file from each stage.
Reason .....................................................................................................................................
...................................................................................................................................................
Benefit ......................................................................................................................................
...................................................................................................................................................
[2]
(b) The teacher has defined the first program module as follows:
Module Description
DeleteSpaces() • called with a parameter of type string representing a line of
pseudocode from a student’s project file
• returns the line after removing any leading space characters
The following example shows a string before and after the leading
spaces have been removed:
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
ENDFUNCTION [6]
Module Description
DeleteComment() • called with a parameter of type string representing a line of
(already written) pseudocode from a student’s project file
• returns the line after removing any comment
Stage_2() • called with two parameters:
○ a string representing an input file name
○ a string representing an output file name
• copies each line from the input file to the existing output file having
first removed all leading spaces and comments from that line
• does not write blank lines to the output file
• outputs a final message giving the number of blank lines removed
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [8]
BLANK PAGE
BLANK PAGE
BLANK PAGE
Permission to reproduce items where third‑party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer‑related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge
Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.
¬O> 3mGwMq=5uUpW
¬bD§43Pt|¤P\M
¥u¥U5U¥5UEUeEeEU
* 6 8 0 6 8 0 7 8 2 2 *
2 hours
INSTRUCTIONS
● Answer all questions.
● Use a black or dark blue pen.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● You may use an HB pencil for any diagrams, graphs or rough working.
● Calculators must not be used in this paper.
INFORMATION
● The total mark for this paper is 75.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.
● The insert contains all the resources referred to in the questions.
DC (KS/CGW) 329352/4
© UCLES 2024 [Turn over
* 0019655333802 *
Refer to the insert for the list of pseudocode functions and operators.
One algorithm is repeated in several places. The code for the algorithm is the same wherever it is
used, but the calculations within the algorithm may operate on different data.
The result of each calculation is used by the code that follows it.
It is decided to modify the program and implement the algorithm as a separate module.
1 ........................................................................................................................................
...........................................................................................................................................
2 ........................................................................................................................................
...........................................................................................................................................
[2]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [3]
DO NOT WRITE IN THIS MARGIN
ĬÍĊ¾Ġ³íÇ÷Íñ½Ğ¸÷×î×
© UCLES 2024 ĬĖĜáÁģ¸ÕçýþģÜõĠĤÕĂ
ĥåõÕõµåÕĥąąÕåÕåĥĥÕ
9618/23/M/J/24
* 0019655333803 *
DO NOT WRITE IN THIS MARGIN
3
, ,
(b) Four of the expressions used in the program are represented by pseudocode in the table.
Complete each pseudocode expression with a function or operator so that it evaluates to the
value shown.
"and"
DO NOT WRITE IN THIS MARGIN
........................................ ("Random", 2, 3)
15
5 + ........................................ (10/11/2023)
TRUE
........................................ ("45000")
(20 ........................................ 3) + 1 3
[4]
DO NOT WRITE IN THIS MARGIN
DO NOT WRITE IN THIS MARGIN
DO NOT WRITE IN THIS MARGIN
ĬÏĊ¾Ġ³íÇ÷Íñ½Ğ¸õ×î×
© UCLES 2024 ĬĖěâÉĥ¼åÒûóæĀý¼ĤåĂ
ĥåąĕµÕŵõõÕÕåµÅåõÕ
9618/23/M/J/24 [Turn over
* 0019655333804 *
2 (a) A program uses a global 1D array of type string and a text file.
Outline five steps for this algorithm that could be used to produce pseudocode.
Step 1 .......................................................................................................................................
...................................................................................................................................................
Step 2 .......................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Step 4 .......................................................................................................................................
...................................................................................................................................................
Step 5 .......................................................................................................................................
...................................................................................................................................................
[5]
Identify one other programming construct that will be required when the algorithm from
part (a) is converted into pseudocode and explain its use.
Construct ..................................................................................................................................
...................................................................................................................................................
Use ...........................................................................................................................................
...................................................................................................................................................
[2]
DO NOT WRITE IN THIS MARGIN
ĬÍĊ¾Ġ³íÇ÷Íñ½Ğ¶÷×ð×
© UCLES 2024 ĬĖěãÉğÊäåõüÝÞáĚôÍĂ
ĥĕÕĕõÕÅĕĕÕåÕĥµĥåĥÕ
9618/23/M/J/24
DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN
,
© UCLES 2024
* 0019655333805 *
ĥĕåÕµµåõąåõÕĥÕąĥõÕ
ĬĖĜäÁĩÆÔÔăąĬúÙ¾ôÝĂ
ĬÏĊ¾Ġ³íÇ÷Íñ½Ğ¶õ×ð×
,
5
9618/23/M/J/24
BLANK PAGE
[Turn over
* 0019655333806 *
3 A record structure is declared to hold data relating to components being produced in a factory:
TYPE Component
DECLARE Item_ID : STRING
DECLARE Reject : BOOLEAN
DECLARE Weight : REAL
ENDTYPE
The factory normally produces a batch (or set) of 1000 components at a time. A global array is
declared to store 1000 records for a batch:
Two global variables contain the minimum and maximum acceptable weight for each component.
The values represent an inclusive range and are declared as:
(a) (i) A program uses a variable ThisIndex as the array index to access a record.
Write a pseudocode clause to check whether or not the weight of an individual component
is within the acceptable range.
...........................................................................................................................................
..................................................................................................................................... [3]
(ii) When batches of less than 1000 components are processed, it is necessary to indicate
that certain elements in the array are unused.
...........................................................................................................................................
components exceeds 5.
ĬÑĊ¾Ġ³íÇ÷Íñ½Ğ·õÖî×
© UCLES 2024 ĬĖěä¾ģÞÚÜĈøđĚáßÜÍĂ
ĥÅąÕµĕåÕÅÅÕÕåÕåååÕ
9618/23/M/J/24
* 0019655333807 *
DO NOT WRITE IN THIS MARGIN
7
, ,
Complete the program flowchart to represent the algorithm for module BatchCheck().
START
DO NOT WRITE IN THIS MARGIN
Is
Index = 1001 ?
DO NOT WRITE IN THIS MARGIN
Yes
No
DO NOT WRITE IN THIS MARGIN
DO NOT WRITE IN THIS MARGIN
END
[5]
ĬÓĊ¾Ġ³íÇ÷Íñ½Ğ·÷Öî×
© UCLES 2024 ĬĖĜãÆĥâêÝòĉؾÙûÜÝĂ
ĥÅõĕõõŵյąÕåµÅĥµÕ
9618/23/M/J/24 [Turn over
* 0019655333808 *
Values input in the first part are totalled using global variable TotalA and those input in the
second part are totalled using global variable TotalB.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [6]
ĬÑĊ¾Ġ³íÇ÷Íñ½ĞµõÖð×
© UCLES 2024 ĬĖĜâÆğÔßÚðĂÏĠõÙÌÕĂ
ĥõåĕµõÅĕµĕõÕĥµĥĥåÕ
9618/23/M/J/24
* 0019655333809 *
DO NOT WRITE IN THIS MARGIN
9
, ,
(b) The value zero denotes the split between the two parts of the sequence.
(i) Identify a suitable data structure that could be used to store the different total values.
..................................................................................................................................... [2]
(ii) Describe three benefits of using the data structure given in part (b)(i).
1 ........................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...........................................................................................................................................
2 ........................................................................................................................................
...........................................................................................................................................
3 ........................................................................................................................................
...........................................................................................................................................
[3]
DO NOT WRITE IN THIS MARGIN
DO NOT WRITE IN THIS MARGIN
DO NOT WRITE IN THIS MARGIN
ĬÓĊ¾Ġ³íÇ÷Íñ½Ğµ÷Öð×
© UCLES 2024 ĬĖěá¾ĩÐÏßĊïĚ¼ýýÌåĂ
ĥõÕÕõĕåõåĥåÕĥÕąåµÕ
9618/23/M/J/24 [Turn over
* 0019655333810 *
Functions FormatA() and FormatB() apply fixed format case changes to the parameter string.
Suggest a more appropriate construct that could be used and explain your choice.
Construct ..................................................................................................................................
Explanation ...............................................................................................................................
...................................................................................................................................................
[2]
(b) The algorithm calls one of the functions FormatA() and FormatB() each time within the
loop.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
ĬÑĊ¾Ġ³íÇ÷Íñ½Ğ¸õØî×
© UCLES 2024 ĬĖęâ¿ĝܹØ÷ĉõĄ÷ôÝĂ
ĥåÅÕµõĥĕĕåõĕĥĕĥĥĕÕ
9618/23/M/J/24
DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN
,
© UCLES 2024
* 0019655333811 *
ĥåµĕõĕąõąÕåĕĥõąåąÕ
ĬĖĚáÇīØÉáāø´ØÿĩôÍĂ
ĬÓĊ¾Ġ³íÇ÷Íñ½Ğ¸÷Øî×
,
11
9618/23/M/J/24
BLANK PAGE
[Turn over
* 0019655333812 *
6 A program displays a progress bar to inform the user of the progress of tasks that take a significant
time to complete, such as those involving file transfer operations.
Task progress is divided into 11 steps. Each step represents the amount of progress as a
percentage. An image is associated with each step and each image is stored in a different file.
Different progress bar images may be selected. For a given image, files all have the same filename
root, with a different suffix.
The table illustrates the process for using the image with filename root BargraphA
ĬÑĊ¾Ġ³íÇ÷Íñ½Ğ¶õØð×
© UCLES 2024 ĬĖĚäÇġæÀÖÿï»öãËĤåĂ
ĥĕĥĕµĕąÕĥõÕĕåõååĕÕ
9618/23/M/J/24
* 0019655333913 *
DO NOT WRITE IN THIS MARGIN
13
, ,
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
............................................................................................................................................. [6]
ĬÓĉ¿Ġ³íÇ÷Íñ½ĞµõØð×
© UCLES 2024 ĬĖĚâÌĞÕêåþă½ģËÔÍĂ
ĥåÅÕµµåµąõõĕĥµåĥåÕ
9618/23/M/J/24 [Turn over
* 0019655333914 *
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [1]
ĬÍĉ¿Ġ³íÇ÷Íñ½Ğ¶öÕò×
© UCLES 2024 ĬĖęäÉĤêÒ×ČĈãġº¿ĤÕĂ
ĥąÅĕõÕĥĕĥĥõÕåõąåõÕ
9618/23/M/J/24
DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN
,
© UCLES 2024
* 0019655333915 *
ĥąµÕµµąõõĕåÕåĕĥĥĥÕ
ĬĖĚãÁĦæââîùĦµÂěĤåĂ
ĬÏĉ¿Ġ³íÇ÷Íñ½Ğ¶øÕò×
,
15
9618/23/M/J/24
BLANK PAGE
[Turn over
* 0019655333916 *
7 Seven program modules form part of a program. A description of the relationship between the
modules is summarised below. Any return values are stated in the description.
..................................................................................................................................... [1]
(ii) Modules Mod-F and Mod-G are both called with Par3 as a parameter.
In the case of Mod-F, the parameter is passed by value.
In the case of Mod-G, the parameter is passed by reference.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
DO NOT WRITE IN THIS MARGIN
ĬÍĉ¿Ġ³íÇ÷Íñ½Ğ¸öÕô×
© UCLES 2024 ĬĖĚâÁĠØçÕôòĝėйôÍĂ
ĥµĥÕõµąÕĕµÕÕĥĕÅĥõÕ
9618/23/M/J/24
* 0019655333917 *
DO NOT WRITE IN THIS MARGIN
17
, ,
(b) Draw a structure chart to show the relationship between the seven modules and the
parameters passed between them.
DO NOT WRITE IN THIS MARGIN
DO NOT WRITE IN THIS MARGIN
DO NOT WRITE IN THIS MARGIN
DO NOT WRITE IN THIS MARGIN
[6]
ĬÏĉ¿Ġ³íÇ÷Íñ½Ğ¸øÕô×
© UCLES 2024 ĬĖęáÉĪÜ×äĆÿìÃĖĝôÝĂ
ĥµĕĕµÕĥµąÅąÕĥõååĥÕ
9618/23/M/J/24 [Turn over
* 0019655333918 *
The program analyses a student project and extracts information about each module that is
defined (each procedure or function). This information is stored in a global 2D array ModInfo of
type string.
A module header is the first line of a module definition and starts with either of the keywords
PROCEDURE or FUNCTION.
An example of part of the array is given below. Row 10 of the array shows that a procedure header
occurs on line 27 and row 11 shows that a function header occurs on line 35. "P" represents a
x = 1 x = 2 x = 3
The string stored in column 3 is called the module description. This is the module header without
the keyword.
Module Description
Header() • called with a parameter of type string representing a line of
pseudocode
• if the line is a valid procedure header, returns a string:
"P<Module description>"
ĬÍĉ¿Ġ³íÇ÷Íñ½Ğµö×ò×
© UCLES 2024 ĬĖěâÌĞбÛûùÇûĠÍÌåĂ
ĥĥąĕõµåÕµąÕĕĥµÅĥÅÕ
9618/23/M/J/24
* 0019655333919 *
DO NOT WRITE IN THIS MARGIN
19
, ,
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [7]
DO NOT WRITE IN THIS MARGIN
ĬÏĉ¿Ġ³íÇ÷Íñ½Ğµø×ò×
© UCLES 2024 ĬĖĜáÄĬÔÁÞýĈĂßĘĉÌÕĂ
ĥĥõÕµÕŵåõąĕĥÕååÕÕ
9618/23/M/J/24 [Turn over
* 0019655333920 *
Module Description
FindModules() • called with a parameter of type string representing a student
project file name
• uses module Header() to check each line of the project
• assigns values to the ModInfo array for each module
declaration in the student project
Assume that the array contains enough rows for the number of modules in each project.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
ĬÍĉ¿Ġ³íÇ÷Íñ½Ğ·ö×ô×
© UCLES 2024 ĬĖĜäÄĢâÈÙăÿĉý¼ëÜÝĂ
ĥÕåÕõÕÅĕÅÕõĕåÕąåÅÕ
9618/23/M/J/24
* 0019655333921 *
DO NOT WRITE IN THIS MARGIN
21
, ,
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [8]
DO NOT WRITE IN THIS MARGIN
DO NOT WRITE IN THIS MARGIN
DO NOT WRITE IN THIS MARGIN
ĬÏĉ¿Ġ³íÇ÷Íñ½Ğ·ø×ô×
© UCLES 2024 ĬĖěãÌĨÞ¸àõòÀÙÄïÜÍĂ
ĥÕÕĕµµåõÕååĕåµĥĥÕÕ
9618/23/M/J/24
,
© UCLES 2024
* 0019655333922 *
ĥąõĕµĕåÕĕÅąĕĥµÅåąÕ
ĬĖĜãÇĞÆ®èòăµ¹¼ĎôÝĂ
ĬÑĉ¿Ġ³íÇ÷Íñ½Ğ¶øÖò×
,
22
9618/23/M/J/24
BLANK PAGE
DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN
DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN DO NOT WRITE IN THIS MARGIN
,
© UCLES 2024
* 0019655333923 *
ĥąąÕõõŵąµÕĕĥÕåĥĕÕ
ĬĖěä¿ĬʾÑĈîôĝÄÊôÍĂ
ĬÓĉ¿Ġ³íÇ÷Íñ½Ğ¶öÖò×
,
23
9618/23/M/J/24
BLANK PAGE
* 0019655333924 *
BLANK PAGE
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge
Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.
ĬÑĉ¿Ġ³íÇ÷Íñ½Ğ¸øÖô×
© UCLES 2024 ĬĖěá¿Ģ¼ËæĊõû¿ĠĬĤåĂ
ĥµÕÕµõÅĕĥĕåĕåÕąĥąÕ
9618/23/M/J/24
Cambridge International AS & A Level
* 6 2 8 1 0 3 5 9 0 4 *
1 hour 30 minutes
INSTRUCTIONS
● Answer all questions.
● Use a black or dark blue pen.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● You may use an HB pencil for any diagrams, graphs or rough working.
● Calculators must not be used in this paper.
INFORMATION
● The total mark for this paper is 75.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.
DC (PQ) 341261
© UCLES 2024 [Turn over
2
1 Real numbers are stored in a computer system using floating-point representation with:
(a) Calculate the denary value of the given normalised floating-point number.
Mantissa Exponent
0 1 0 0 1 1 1 1 0 0 0 0 1 0 0 1
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Answer ......................................................................................................................................
[3]
Mantissa Exponent
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[3]
(a) Complete the diagram to show the correct order for these layers.
[2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(c) Outline one protocol that is associated with the Application layer.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
(b) Write pseudocode statements to declare the record data type FootballClub to hold data
about football clubs in a league, to include:
• name of team
• date team joined the league
• main telephone number
• name of the manager
• number of members
• current position in the league.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) Explain how the sequential method of file access is applied to files with serial organisation
and to files with sequential organisation.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
5 2 + 9 3 - / 3 *
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
((7 + 3) - (2 * 8)) / 6
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
a b - c d + * e /
when
a = 17, b = 5, c = 7, d = 3 and e = 10
Show the changing contents of the stack as the RPN expression is evaluated.
[4]
A Q
P R
B Z
(a) Complete the truth table for the given logic circuit.
Working space
A B C P Q R S Z
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
[3]
(b) Write the Boolean expression that corresponds to the logic circuit as a sum-of-products.
Z = ............................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(c) (i) Complete the Karnaugh map (K-map) for the Boolean expression:
BC
00 01 11 10
A
[2]
(ii) Draw loop(s) around appropriate group(s) in the K-map to produce an optimal
sum-of-products. [2]
(iii) Write the Boolean expression from your answer to part (c)(ii) as a simplified
sum-of-products.
...........................................................................................................................................
..................................................................................................................................... [1]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
8 A declarative programming language is used to represent the features that are available and the
features that are unavailable on different body styles of a car.
01 feature(sunroof).
02 feature(automatic_tailgate).
03 feature(heated_seats).
04 feature(extra_seats).
05 feature(reversing_camera).
06 feature(dashboard_camera).
07 feature(air_conditioning).
08 feature(heated_windscreen).
09 feature(satnav).
10 bodystyle(saloon).
11 bodystyle(hatchback).
12 bodystyle(estate).
13 bodystyle(minivan).
14 bodystyle(convertible).
15 available(sunroof, hatchback).
16 available(sunroof, minivan).
17 available(reversing_camera, hatchback).
18 available(extra_seats, minivan).
19 available(reversing_camera, saloon).
20 unavailable(sunroof, convertible).
21 unavailable(automatic_tailgate, saloon).
22 unavailable(extra_seats, hatchback).
Clause Meaning
01 Sunroof is a feature.
10 Saloon is a body style.
15 Sunroof is available on a hatchback.
20 Sunroof is unavailable on a convertible.
(a) Sliding doors is a feature that is available on a minivan but unavailable on a hatchback.
23 .............................................................................................................................................
24 .............................................................................................................................................
25 .............................................................................................................................................
[3]
available(Options, saloon)
returns
Options = reversing_camera
available(Options, hatchback)
(c) F may be available for B if F is a feature and B is a body style and F is not unavailable for that
body style.
may_choose_option(F, B)
IF .............................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
.................................................................................................................................................... [3]
10 (a) State a condition that must be true for an array to be searchable for a binary search.
...................................................................................................................................................
............................................................................................................................................. [1]
(b) Complete the given pseudocode to find an item in a 1D array Names of type STRING using a
binary search.
...................................................................................................................................................
NotInList ← FALSE
WHILE ................................................ AND ................................................
CurrentItem ←
(TopOfList + EndOfList) DIV 2
IF ........................................................................................................... THEN
Found ← TRUE
ELSE
IF TopOfList >= EndOfList THEN
...........................................................................................................
ELSE
IF ToFind > Names[CurrentItem] THEN
...........................................................................................................
ELSE
EndOfList ←
CurrentItem – 1
ENDIF
ENDIF
ENDIF
ENDWHILE
IF Found = TRUE THEN
OUTPUT "Item found at position ", CurrentItem, " in array"
ELSE
OUTPUT "Item not in array"
ENDIF
[5]
(c) Describe the performance of a binary search in relation to the number of data items in the
array being searched. Refer to Big O notation in your answer.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
11 Reduced Instruction Set Computers (RISC) and Complex Instruction Set Computers (CISC) are
two types of processor.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) Outline the process of interrupt handling as it could be applied to RISC or CISC processors.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
(c) Explain how pipelining affects interrupt handling for RISC processors.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
BLANK PAGE
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge
Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.
1 hour 30 minutes
INSTRUCTIONS
● Answer all questions.
● Use a black or dark blue pen.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● You may use an HB pencil for any diagrams, graphs or rough working.
● Calculators must not be used in this paper.
INFORMATION
● The total mark for this paper is 75.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.
DC (DE) 352034/4
© UCLES 2024 [Turn over
2
1 (a) Describe the effect of changing the allocation of bits used for the mantissa and for the
exponent in a floating-point number with a fixed total number of bits.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) Real numbers are stored in a computer, using floating-point representation with:
Mantissa Exponent
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
2 (a) Outline why protocols are essential for communication between computers.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) State the names of two different protocols associated with the sending and receiving of
emails between computers.
Sending ....................................................................................................................................
Receiving ..................................................................................................................................
[2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
3 (a) Explain what is meant by the term non-composite data type and give an example of a
non-composite data type.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Example ....................................................................................................................................
[3]
(b) Write pseudocode statements to declare the set data type EvenNumbers to hold this set of
even numbers between 2 and 12:
2, 4, 6, 8, 10, 12
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
4 Sheila has a customer called Fred. Fred wants to send Sheila a confidential document as part of a
transaction.
Explain how Fred uses asymmetric encryption to send his document securely.
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
.................................................................................................................................................... [4]
(7 – 2 + 8) / (9 – 5)
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
a d + a b + c - *
when
a = 6, b = 3, c = 7 and d = 9
Show the changing contents of the stack as the RPN expression is evaluated.
[4]
b a c - + d b + * c /
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
P
A
S
Q
B Z
T
R
C
(a) Complete the truth table for the given logic circuit.
Show your working.
Working space
A B C P Q R S T Z
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
[3]
(b) Write the Boolean expression that corresponds to the logic circuit as a sum-of-products.
Z = ............................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(c) (i) Complete the Karnaugh map (K-map) for this Boolean expression:
–– – – – – –– –
A.B.C + A.B.C + A.B.C + A.B.C + A.B.C + A.B.C
BC
A 00 01 11 10
[2]
(ii) Draw loop(s) around appropriate group(s) in the K-map to produce an optimal
sum-of-products. [2]
(iii) Write the Boolean expression from your answer to part c(ii) as a simplified
sum-of-products.
...........................................................................................................................................
..................................................................................................................................... [1]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) Explain how direct access is used to locate a specific record in sequential files and random
files.
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
8 (a) Complete the pseudocode to find an item in a 1D array Widgets of type STRING, using a
linear search.
…………………………………………………………………………………………………………………………………
NotInList FALSE
Count TopOfList
IF ……………………………………………………………………………………………………………………………… THEN
Found TRUE
ENDIF
Count Count + 1
IF …………………………………………………………………………………………………………………………… THEN
NotInList TRUE
ENDIF
ENDWHILE
IF Found = TRUE THEN
OUTPUT "Item found at position ", Count - 1, " in array"
ELSE
OUTPUT "Item not in array"
ENDIF
[4]
(b) Compare the methods used by the linear and binary search algorithms to find an item in an
array. Refer to Big O notation in your answer.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
Benefit 1 ...................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Benefit 2 ...................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Limitation 1 ...............................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Limitation 2 ...............................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[4]
(b) Explain the roles of the host operating system and the guest operating system as used in a
computer system running a virtual machine.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
10 A declarative programming language is used to allow clients to choose daily activities at the
beach.
01 activity(paddleboarding).
02 activity(sailing).
03 activity(rowing).
04 activity(kayaking).
05 activity(jetskiing).
06 client(stevie).
07 client(antonio).
08 client(henry).
09 client(eliza).
10 client(rebeka).
11 client(danny).
12 client(erik).
13 client(simone).
14 client(petra).
15 client(frankie).
16 choice(petra, rowing).
17 choice(frankie, sailing).
18 choice(erik, sailing).
19 choice(eliza, rowing).
20 choice(stevie, jetskiing).
21 choice(henry, sailing).
22 done(henry, jetskiing).
23 done(rebeka, jetskiing).
24 done(antonio, kayaking).
Clause Meaning
01 Paddle boarding is an activity.
06 Stevie is a client.
16 Petra has chosen rowing.
22 Henry has already done jet skiing.
(a) Jane is a client who would like to choose the activity surfing and she has already done sailing.
25 .............................................................................................................................................
26 .............................................................................................................................................
27 .............................................................................................................................................
28 .............................................................................................................................................
[4]
choice(List, rowing)
returns
choice(List, sailing)
(c) C is a client who would like to choose A if A is an activity and C has not already done A.
may_choose_activity(C, A)
IF ............................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
.................................................................................................................................................... [3]
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge
Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.
¬Wz> 3mKsgy=<5 W
¬`E¤ifbpWBtN
¥5u5Eu5e¥U5 eUEU
* 0 5 3 4 4 0 8 3 9 9 *
1 hour 30 minutes
INSTRUCTIONS
● Answer all questions.
● Use a black or dark blue pen.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● You may use an HB pencil for any diagrams, graphs or rough working.
● Calculators must not be used in this paper.
INFORMATION
● The total mark for this paper is 75.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.
DC (LK/CGW) 329375/5
© UCLES 2024 [Turn over
* 0019655539702 *
1 Real numbers are stored in a computer system using floating-point representation with:
(a) Calculate the denary value of the given normalised floating-point number.
Mantissa Exponent
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Answer ......................................................................................................................................
[3]
Mantissa Exponent
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
[3]
ĬÕú¾Ġ³íËóçù½Ė¹ĕ·Ğ×
© UCLES 2024 ĬĚĜßÈĨÝÄÙāð÷²ÝòÌÖĂ
ĥĥĥĕõõąĕąĥµĕµÅÅĕĥÕ
9618/33/M/J/24
* 0019655539703 *
DO NOT WRITE IN THIS MARGIN
3
, ,
(a) Complete the diagram to show the correct order for these layers.
DO NOT WRITE IN THIS MARGIN
[2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
............................................................................................................................................. [2]
(c) Outline one protocol that is associated with the Application layer.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
............................................................................................................................................. [3]
Ĭ×ú¾Ġ³íËóçù½Ė¹ė·Ğ×
© UCLES 2024 ĬĚěàÀĢá´à÷ā²ĦÕæÌæĂ
ĥĥĕÕµĕĥõĕĕĥĕµååÕõÕ
9618/33/M/J/24 [Turn over
* 0019655539704 *
(b) Write pseudocode statements to declare the record data type FootballClub to hold data
about football clubs in a league, to include:
• name of team
• date team joined the league
• main telephone number
• name of the manager
• number of members
• current position in the league.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) Explain how the sequential method of file access is applied to files with serial organisation
and to files with sequential organisation.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
ĬÕú¾Ġ³íËóçù½Ė»ĕ·Ġ×
© UCLES 2024 ĬĚěÝÀĬÓµÛùĊ¹ÈùĈÜÎĂ
ĥÕÅÕõĕĥÕõµĕĕõåąÕĥÕ
9618/33/M/J/24
* 0019655539705 *
DO NOT WRITE IN THIS MARGIN
5
, ,
5 2 + 9 3 - / 3 *
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
DO NOT WRITE IN THIS MARGIN
((7 + 3) - (2 * 8)) / 6
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
DO NOT WRITE IN THIS MARGIN
a b - c d + * e /
when
a = 17, b = 5, c = 7, d = 3 and e = 10
Show the changing contents of the stack as the RPN expression is evaluated.
DO NOT WRITE IN THIS MARGIN
[4]
DO NOT WRITE IN THIS MARGIN
Ĭ×ú¾Ġ³íËóçù½Ė»ė·Ġ×
© UCLES 2024 ĬĚĜÞÈĞÏÅÞÿ÷ðĔāÔÜÞĂ
ĥÕµĕµõąµĥÅÅĕõÅĥĕõÕ
9618/33/M/J/24 [Turn over
* 0019655539706 *
A Q
P R
B Z
(a) Complete the truth table for the given logic circuit.
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 1
[3]
(b) Write the Boolean expression that corresponds to the logic circuit as a sum-of-products.
Z = ............................................................................................................................................
...................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
............................................................................................................................................. [2]
ĬÙú¾Ġ³íËóçù½Ėºė¶Ğ×
© UCLES 2024 ĬĚěÞËĨ·¿æČĆąôù±ôÎĂ
ĥąĕĕµÕąĕååĥĕµÅÅÕåÕ
9618/33/M/J/24
* 0019655539807 *
DO NOT WRITE IN THIS MARGIN
7
, ,
(c) (i) Complete the Karnaugh map (K-map) for the Boolean expression:
BC
00 01 11 10
A
1
DO NOT WRITE IN THIS MARGIN
[2]
(ii) Draw loop(s) around appropriate group(s) in the K-map to produce an optimal
sum-of-products. [2]
(iii) Write the Boolean expression from your answer to part (c)(ii) as a simplified
sum-of-products.
...........................................................................................................................................
..................................................................................................................................... [1]
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
............................................................................................................................................. [3]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
DO NOT WRITE IN THIS MARGIN
ĬÛù¿Ġ³íËóçù½Ė¹ė¶Ğ×
© UCLES 2024 ĬĚěàÈīÈéÕĉú²Ë¹±ÄæĂ
ĥµµÕµõåõÅåÅĕõąÅĕĕÕ
9618/33/M/J/24 [Turn over
* 0019655539808 *
8 A declarative programming language is used to represent the features that are available and the
features that are unavailable on different body styles of a car.
01 feature(sunroof).
02 feature(automatic_tailgate).
03 feature(heated_seats).
04 feature(extra_seats).
05 feature(reversing_camera).
06 feature(dashboard_camera).
07 feature(air_conditioning).
08 feature(heated_windscreen).
Clause Meaning
01 Sunroof is a feature.
10 Saloon is a body style.
15 Sunroof is available on a hatchback.
20 Sunroof is unavailable on a convertible.
23 .............................................................................................................................................
24 .............................................................................................................................................
25 .............................................................................................................................................
[3]
DO NOT WRITE IN THIS MARGIN
ĬÙù¿Ġ³íËóçù½Ė»ĕ¶Ġ×
© UCLES 2024 ĬĚěÝÈġ¶àâćñ¹ĩĕēÔÎĂ
ĥąĥÕõõåÕåąµĕµąĥĕąÕ
9618/33/M/J/24
* 0019655539809 *
DO NOT WRITE IN THIS MARGIN
9
, ,
available(Options, saloon)
returns
Options = reversing_camera
available(Options, hatchback)
DO NOT WRITE IN THIS MARGIN
(c) F may be available for B if F is a feature and B is a body style and F is not unavailable for that
body style.
may_choose_option(F, B)
IF .............................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
..........................................................................................................................................................
..........................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
.................................................................................................................................................... [3]
DO NOT WRITE IN THIS MARGIN
ĬÛù¿Ġ³íËóçù½Ė»ė¶Ġ×
© UCLES 2024 ĬĚĜÞÀħºÐ×ñĀðĝÇÔÞĂ
ĥąĕĕµĕŵµõĥĕµĥąÕĕÕ
9618/33/M/J/24 [Turn over
* 0019655539810 *
10 (a) State a condition that must be true for an array to be searchable for a binary search.
...................................................................................................................................................
............................................................................................................................................. [1]
(b) Complete the given pseudocode to find an item in a 1D array Names of type STRING using a
binary search.
...................................................................................................................................................
IF ........................................................................................................... THEN
Found ← TRUE
ELSE
IF TopOfList >= EndOfList THEN
...........................................................................................................
ELSE
...........................................................................................................
ELSE
EndOfList ←
CurrentItem – 1
ENDIF
ENDIF
ENDIF
ENDWHILE
IF Found = TRUE THEN
OUTPUT "Item found at position ", CurrentItem, " in array"
ELSE
OUTPUT "Item not in array"
DO NOT WRITE IN THIS MARGIN
ENDIF
[5]
ĬÙù¿Ġ³íËóçù½Ėºĕ¸Ğ×
© UCLES 2024 ĬĚĚÝ½ģ®ºàĀúēąė÷ĬæĂ
ĥÕąĕõõąÕąµµÕµåĥĕµÕ
9618/33/M/J/24
* 0019655539811 *
DO NOT WRITE IN THIS MARGIN
11
, ,
(c) Describe the performance of a binary search in relation to the number of data items in the
array being searched. Refer to Big O notation in your answer.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
DO NOT WRITE IN THIS MARGIN
11 Reduced Instruction Set Computers (RISC) and Complex Instruction Set Computers (CISC) are
two types of processor.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
............................................................................................................................................. [2]
(b) Outline the process of interrupt handling as it could be applied to RISC or CISC processors.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
............................................................................................................................................. [3]
(c) Explain how pipelining affects interrupt handling for RISC processors.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
DO NOT WRITE IN THIS MARGIN
...................................................................................................................................................
............................................................................................................................................. [3]
ĬÛù¿Ġ³íËóçù½Ėºė¸Ğ×
© UCLES 2024 ĬĚęÞÅĥ²ÊÙúćÖÑğãĬÖĂ
ĥÕõÕµĕĥµĕÅĥÕµÅąÕåÕ
9618/33/M/J/24
* 0019655539812 *
BLANK PAGE
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge
Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.
ĬÙù¿Ġ³íËóçù½Ė¼ĕ¸Ġ×
© UCLES 2024 ĬĚęßÅğÄ¿ÞøĀÍóÃāüÞĂ
ĥĥåÕõĕĥĕõĥĕÕõÅåÕµÕ
9618/33/M/J/24
Cambridge International AS & A Level
2 hours 30 minutes
evidence.doc
INSTRUCTIONS
● Carry out every instruction in each task.
● Save your work using the file names given in the task as and when instructed.
● You must not have access to either the internet or any email system during this examination.
● You must save your work in the evidence document as stated in the tasks. If work is not saved in the
evidence document, you will not receive marks for that task.
● You must use a high‑level programming language from this list:
Java (console mode)
Python (console mode)
Visual Basic (console mode)
● A mark of zero will be awarded if a programming language other than those listed here is used.
INFORMATION
● The total mark for this paper is 75.
● The number of marks for each question or part question is shown in brackets [ ].
DC (WW) 340659
© UCLES 2024 [Turn over
2
Make sure that your name, centre number and candidate number will appear on every page of this
document. This document must contain your answers to each question.
If the programming language used does not support arrays, a list can be used instead.
One source file is used to answer Question 2. The file is called Trees.txt
1 A program needs to take integer numbers as input, sort the numbers and then search for a specific
number.
(a) The integer numbers will be stored in the global 1D array, DataStored, with space for up to
20 integers.
The global variable NumberItems stores the quantity of items the array contains.
Copy and paste the program code into part 1(a) in the evidence document.
[1]
• prompts the user to input the quantity of numbers the user would like to enter
• reads the input and validates it is between 1 and 20 (inclusive)
• prompts the user to input each number and stores each number in DataStored.
Copy and paste the program code into part 1(b) in the evidence document.
[5]
(c) The main program stores 0 in NumberItems, calls Initialise() and then outputs the
contents of DataStored.
Copy and paste the program code into part 1(c)(i) in the evidence document.
[2]
(ii) Test your program by inputting the following data in the order given:
30
5
3
9
4
1
2
Take a screenshot of the output(s).
Copy and paste the screenshot into part 1(c)(ii) in the evidence document.
[2]
(d) The procedure BubbleSort() uses a bubble sort to sort the data in DataStored into
ascending numerical order.
Copy and paste the program code into part 1(d)(i) in the evidence document.
[4]
(ii) Write program code to amend the main program to call BubbleSort() and then output
the contents of DataStored.
Copy and paste the program code into part 1(d)(ii) in the evidence document.
[1]
(iii) Test your program by inputting the following data in the order given:
5
3
9
4
1
2
Take a screenshot of the output(s).
Copy and paste the screenshot into part 1(d)(iii) in the evidence document.
[1]
Copy and paste the program code into part 1(e)(i) in the evidence document.
[6]
Copy and paste the program code into part 1(e)(ii) in the evidence document.
[3]
Test 1: 5 1 6 2 8 10 2
Test 2: 5 1 6 2 8 10 7
Copy and paste the screenshot into part 1(e)(iii) in the evidence document.
[2]
The user can enter their requirements for a tree and a suitable tree will be selected.
Tree
TreeName : STRING stores the name of the tree
HeightGrowth : INTEGER stores the number of cm the tree will grow each year
MaxHeight : INTEGER stores the maximum height in cm that the tree will grow
MaxWidth : INTEGER stores the maximum width in cm that the tree will grow
Evergreen : STRING stores whether the tree keeps its leaves as "Yes", or
loses its leaves as "No"
Constructor() initialises TreeName, HeightGrowth, MaxHeight,
MaxWidth and Evergreen to its parameter values
GetGrowth() returns the number of cm the tree will grow each year
GetMaxHeight() returns the maximum height in cm that the tree will grow
GetMaxWidth() returns the maximum width in cm that the tree will grow
GetEvergreen() returns whether the tree keeps its leaves or loses its
leaves
(a) (i) Write program code to declare the class Tree and its constructor.
Copy and paste the program code into part 2(a)(i) in the evidence document.
[4]
Copy and paste the program code into part 2(a)(ii) in the evidence document.
[3]
Beech,30,400,200,No
The tree is a Beech. It can grow 30 cm each year. It has a maximum height of 400 cm.
It has a maximum width of 200 cm. It is not evergreen (it loses its leaves).
Copy and paste the program code into part 2(b) in the evidence document.
[7]
(c) The procedure PrintTrees() takes a Tree object as a parameter and outputs the tree’s
name, height growth each year, maximum height, maximum width and whether it is evergreen.
TreeName has a maximum height MaxHeight a maximum width MaxWidth and grows
HeightGrowth cm a year. It does not lose its leaves.
TreeName has a maximum height MaxHeight a maximum width MaxWidth and grows
HeightGrowth cm a year. It loses its leaves each year.
Copy and paste the program code into part 2(c) in the evidence document.
[4]
(d) The main program calls ReadData(), stores the return value and calls PrintTrees() with
the first object in the returned array.
Copy and paste the program code into part 2(d)(i) in the evidence document.
[2]
Copy and paste the screenshot into part 2(d)(ii) in the evidence document.
[1]
The procedure prompts the user to input their requirements for a tree.
The user needs to enter:
• the tree’s maximum height is not more than the user’s input
and
• the tree’s maximum width is not more than the user’s input
and
The procedure creates a new array of all the Tree objects that meet all the requirements.
The procedure calls PrintTrees() for each Tree object that meets all the requirements. If
there are no trees that meet all the requirements, a suitable message is output.
Copy and paste the program code into part 2(e)(i) in the evidence document.
[6]
(ii) The procedure ChooseTree() needs amending. After the procedure has output the list
of trees that meet all the requirements, the procedure needs to:
• take as input the name of one of the trees that the user would like to buy from those
that meet all the requirements
• take as input the height of the tree in cm when it is bought
• calculate and output how many years it will take the tree to grow to its maximum
height.
For example, the user inputs the tree, Beech. The tree’s height is 40 cm when bought.
The tree will take 12 years to reach its maximum height of 400 cm.
Copy and paste the program code into part 2(e)(ii) in the evidence document.
[2]
(iii) Write program code to amend the main program to call ChooseTrees().
When asked for the tree selection, use the following data:
Copy and paste the screenshot into part 2(e)(iii) in the evidence document.
[2]
3 A program reads data from the user and stores the data that is valid in a linear queue.
The queue is stored as a global 1D array, QueueData, of string values. The array needs space for
20 elements.
The global variable QueueHead stores the index of the first element in the queue.
The global variable QueueTail stores the index of the last element in the queue.
(a) The main program initialises all the elements in QueueData to a suitable null value,
QueueHead to −1 and QueueTail to −1.
Copy and paste the program code into part 3(a) in the evidence document.
[1]
(b) The function Enqueue() takes the data to insert into the queue as a parameter.
If the queue is not full, it inserts the parameter in the queue, updates the appropriate pointer(s)
and returns TRUE. If the queue is full, it returns FALSE.
Copy and paste the program code into part 3(b) in the evidence document.
[4]
(c) The function Dequeue() returns "false" if the queue is empty. If the queue is not empty, it
returns the next item in the queue and updates the appropriate pointer(s).
Copy and paste the program code into part 3(c) in the evidence document.
[3]
(d) The string values to be stored in the queue are 7 characters long. The first 6 characters are
digits and the 7th character is a check digit. The check digit is calculated from the first 6 digits
using this algorithm:
Example:
Data is 954123
Character position 0 1 2 3 4 5
Digit 9 5 4 1 2 3
Multiplier 1 3 1 3 1 3
Product 9 15 4 3 2 9
Sum of products = 9 + 15 + 4 + 3 + 2 + 9 = 42
A 7‑character string is valid if the 7th character matches the check digit for that data. For
example, the data 9541235 is invalid because the 7th character (5) does not match the check
digit for 954123.
(i) The subroutine StoreItems() takes ten 7‑character strings as input from the user and
uses the check digit to validate each input.
Each valid input has the check digit removed and is stored in the queue using
Enqueue().
An appropriate message is output if the item is inserted. An appropriate message is
output if the queue is already full.
The subroutine counts and outputs the number of invalid items that were entered.
Copy and paste the program code into part 3(d)(i) in the evidence document.
[6]
• call StoreItems()
• call Dequeue()
• output a suitable message if the queue was empty
• output the returned value if the queue was not empty.
Copy and paste the program code into part 3(d)(ii) in the evidence document.
[1]
(iii) Test the program with the following inputs in the order given:
999999X
1251484
5500212
0033585
9845788
6666666
3258746
8111022
7568557
0012353
Copy and paste the screenshot into part 3(d)(iii) in the evidence document.
[2]
BLANK PAGE
BLANK PAGE
BLANK PAGE
Permission to reproduce items where third‑party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer‑related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge
Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.
2 hours 30 minutes
evidence.doc
INSTRUCTIONS
● Carry out every instruction in each task.
● Save your work using the file names given in the task as and when instructed.
● You must not have access to either the internet or any email system during this examination.
● You must save your work in the evidence document as stated in the tasks. If work is not saved in the
evidence document, you will not receive marks for that task.
● You must use a high‑level programming language from this list:
Java (console mode)
Python (console mode)
Visual Basic (console mode)
● A mark of zero will be awarded if a programming language other than those listed here is used.
INFORMATION
● The total mark for this paper is 75.
● The number of marks for each question or part question is shown in brackets [ ].
DC (PQ/CGW) 329377/3
© UCLES 2024 [Turn over
2
Make sure that your name, centre number and candidate number will appear on every page of this
document. This document must contain your answers to each question.
A class declaration can be used to declare a record. If the programming language used does not
support arrays, a list can be used instead.
Three source files are used to answer Question 1. The files are called Easy.txt, Medium.txt and
Hard.txt
1 A program outputs a main word. The program asks the user to enter the different words of 3 or
more letters that can be made from the letters in the main word. These are called the answers.
There are 3 files: Easy.txt, Medium.txt and Hard.txt. Each file has the main word on the
first line. For example, the main word in Easy.txt is house.
The answers are stored in the file. Each answer is on a new line after the main word. For example,
Easy.txt has 14 answers that can be made from the letters in house.
The words read from the text file are stored in the global array WordArray. The number of words
that can be made from the letters in the main word is stored in the global variable NumberWords.
Copy and paste the program code into part 1(a) in the evidence document.
[6]
(b) The main program asks the user to enter "easy", "medium" or "hard" and calls
ReadWords()with the filename that matches the user’s input. For example, if the user enters
"easy", the parameter is "Easy.txt".
Copy and paste the program code into part 1(b) in the evidence document.
[4]
• outputs the main word from the array and the number of answers
• allows the user to enter words until they enter the word ‘no’ to indicate they want to
stop
• outputs whether each word the user enters is an answer or not an answer
• counts the number of answers the user gets correct
• replaces each answer that the user gets correct with a null value in the array.
Copy and paste the program code into part 1(c)(i) in the evidence document.
[6]
(ii) Amend the procedure Play()so that when the user enters the command to stop, the
procedure:
• outputs the percentage of answers the user entered from the array
• outputs all the answers that the user did not enter.
Copy and paste the program code into part 1(c)(ii) in the evidence document.
[3]
(d) (i) The procedure ReadWords()calls Play()after the data in the file has been read.
Copy and paste the program code into part 1(d)(i) in the evidence document.
[1]
(ii) Test your program by inputting these words in the order shown:
easy
she
out
no
Copy and paste the screenshot into part 1(d)(ii) in the evidence document.
[1]
(iii) Test your program by inputting these words in the order shown:
hard
fine
fined
idea
no
Copy and paste the screenshot into part 1(d)(iii) in the evidence document.
[1]
BLANK PAGE
15
8 19
3 10
A computer program stores integers in a binary tree in ascending order. The program uses
Object‑Oriented Programming (OOP).
The binary tree is stored as a 1D array of nodes. Each node contains a left pointer, a data value
and a right pointer.
Node
LeftPointer : INTEGER stores the index of the node to the left in the binary tree
RightPointer : INTEGER stores the index of the node to the right in the binary tree
Constructor() initialises Data to its parameter value
initialises LeftPointer and RightPointer to −1
(a) (i) Write program code to declare the class Node and its constructor.
Copy and paste the program code into part 2(a)(i) in the evidence document.
[4]
© UCLES 2024 9618/42/M/J/24
7
(ii) The get methods GetLeft(), GetRight()and GetData()each return the relevant
attribute.
Copy and paste the program code into part 2(a)(ii) in the evidence document.
[3]
(iii) The set methods SetLeft(), SetRight()and SetData()each take a parameter and
then store this in the relevant attribute.
Copy and paste the program code into part 2(a)(iii) in the evidence document.
[3]
(b) The class TreeClass stores the data about the binary tree.
TreeClass
Tree[0:19] : Node an array of 20 elements of type Node
FirstNode : INTEGER stores the index of the first node in the tree
OutputTree() outputs the left pointer, data and right pointer of each
node in Tree
(i) Write program code to declare the class TreeClass and its constructor.
Copy and paste the program code into part 2(b)(i) in the evidence document.
[4]
© UCLES 2024 9618/42/M/J/24 [Turn over
8
(ii) The method InsertNode()takes a Node object, NewNode, as a parameter and inserts
it into the array Tree.
Copy and paste the program code into part 2(b)(ii) in the evidence document.
[6]
(iii) The method OutputTree()outputs the left pointer, the data and the right pointer for
each node that has been inserted into the tree. The outputs are in the order they are
saved in the array.
If there are no nodes in the array, the procedure outputs ‘No nodes’.
Copy and paste the program code into part 2(b)(iii) in the evidence document.
[4]
(c) (i) The main program declares an instance of TreeClass with the identifier TheTree.
Copy and paste the program code into part 2(c)(i) in the evidence document.
[1]
(ii) The main program inserts the following integers into the binary tree in the order given:
10
11
20
15
Copy and paste the program code into part 2(c)(ii) in the evidence document.
[4]
Copy and paste the screenshot into part 2(c)(iii) in the evidence document.
[1]
3 A program sorts an array of integers and searches the array for a particular value.
(a) The array of integers, NumberArray, stores the following data in the order given:
100 85 644 22 15 8 1
Copy and paste the program code into part 3(a) in the evidence document.
[1]
(b) (i) The following recursive pseudocode function sorts the array into ascending order using
an insertion sort and returns the sorted array.
Copy and paste the program code into part 3(b)(i) in the evidence document.
[4]
Copy and paste the program code into part 3(b)(ii) in the evidence document.
[2]
Copy and paste the screenshot into part 3(b)(iii) in the evidence document.
[1]
(i) Write program code for the function IterativeInsertion()to perform the same
processes as RecursiveInsertion()but using iteration instead of recursion.
Copy and paste the program code into part 3(c)(i) in the evidence document.
[4]
Copy and paste the program code into part 3(c)(ii) in the evidence document.
[1]
Copy and paste the screenshot into part 3(c)(iii) in the evidence document.
[1]
The function uses recursion to perform a binary search for ToFind in IntegerArray.
The function returns the index where ToFind is stored or returns −1 if ToFind is not in the
array.
Copy and paste the program code into part 3(d)(i) in the evidence document.
[6]
• call BinarySearch()with the sorted array and the integer 644 as the search value
• output ‘Not found’ if 644 is not found in the array
• output the index if 644 is found in the array.
Copy and paste the program code into part 3(d)(ii) in the evidence document.
[2]
Copy and paste the screenshot into part 3(d)(iii) in the evidence document.
[1]
BLANK PAGE
BLANK PAGE
BLANK PAGE
Permission to reproduce items where third‑party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer‑related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge
Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.
2 hours 30 minutes
evidence.doc
INSTRUCTIONS
● Carry out every instruction in each task.
● Save your work using the file names given in the task as and when instructed.
● You must not have access to either the internet or any email system during this examination.
● You must save your work in the evidence document as stated in the tasks. If work is not saved in the
evidence document, you will not receive marks for that task.
● You must use a high‑level programming language from this list:
Java (console mode)
Python (console mode)
Visual Basic (console mode)
● A mark of zero will be awarded if a programming language other than those listed here is used.
INFORMATION
● The total mark for this paper is 75.
● The number of marks for each question or part question is shown in brackets [ ].
DC (SL) 329378/3
© UCLES 2024 [Turn over
2
Make sure that your name, centre number and candidate number will appear on every page of this
document. This document must contain your answers to each question.
If the programming language used does not support arrays, a list can be used instead.
One source file is used to answer Question 2. The file is called Trees.txt
1 A program needs to take integer numbers as input, sort the numbers and then search for a specific
number.
(a) The integer numbers will be stored in the global 1D array, DataStored, with space for up to
20 integers.
The global variable NumberItems stores the quantity of items the array contains.
Copy and paste the program code into part 1(a) in the evidence document.
[1]
• prompts the user to input the quantity of numbers the user would like to enter
• reads the input and validates it is between 1 and 20 (inclusive)
• prompts the user to input each number and stores each number in DataStored.
Copy and paste the program code into part 1(b) in the evidence document.
[5]
(c) The main program stores 0 in NumberItems, calls Initialise() and then outputs the
contents of DataStored.
Copy and paste the program code into part 1(c)(i) in the evidence document.
[2]
(ii) Test your program by inputting the following data in the order given:
30
5
3
9
4
1
2
Take a screenshot of the output(s).
Copy and paste the screenshot into part 1(c)(ii) in the evidence document.
[2]
(d) The procedure BubbleSort() uses a bubble sort to sort the data in DataStored into
ascending numerical order.
Copy and paste the program code into part 1(d)(i) in the evidence document.
[4]
(ii) Write program code to amend the main program to call BubbleSort() and then output
the contents of DataStored.
Copy and paste the program code into part 1(d)(ii) in the evidence document.
[1]
(iii) Test your program by inputting the following data in the order given:
5
3
9
4
1
2
Take a screenshot of the output(s).
Copy and paste the screenshot into part 1(d)(iii) in the evidence document.
[1]
Copy and paste the program code into part 1(e)(i) in the evidence document.
[6]
Copy and paste the program code into part 1(e)(ii) in the evidence document.
[3]
Test 1: 5 1 6 2 8 10 2
Test 2: 5 1 6 2 8 10 7
Copy and paste the screenshot into part 1(e)(iii) in the evidence document.
[2]
The user can enter their requirements for a tree and a suitable tree will be selected.
Tree
TreeName : STRING stores the name of the tree
HeightGrowth : INTEGER stores the number of cm the tree will grow each year
MaxHeight : INTEGER stores the maximum height in cm that the tree will grow
MaxWidth : INTEGER stores the maximum width in cm that the tree will grow
Evergreen : STRING stores whether the tree keeps its leaves as "Yes", or
loses its leaves as "No"
Constructor() initialises TreeName, HeightGrowth, MaxHeight,
MaxWidth and Evergreen to its parameter values
GetGrowth() returns the number of cm the tree will grow each year
GetMaxHeight() returns the maximum height in cm that the tree will grow
GetMaxWidth() returns the maximum width in cm that the tree will grow
GetEvergreen() returns whether the tree keeps its leaves or loses its
leaves
(a) (i) Write program code to declare the class Tree and its constructor.
Copy and paste the program code into part 2(a)(i) in the evidence document.
[4]
Copy and paste the program code into part 2(a)(ii) in the evidence document.
[3]
Beech,30,400,200,No
The tree is a Beech. It can grow 30 cm each year. It has a maximum height of 400 cm.
It has a maximum width of 200 cm. It is not evergreen (it loses its leaves).
Copy and paste the program code into part 2(b) in the evidence document.
[7]
(c) The procedure PrintTrees() takes a Tree object as a parameter and outputs the tree’s
name, height growth each year, maximum height, maximum width and whether it is evergreen.
TreeName has a maximum height MaxHeight a maximum width MaxWidth and grows
HeightGrowth cm a year. It does not lose its leaves.
TreeName has a maximum height MaxHeight a maximum width MaxWidth and grows
HeightGrowth cm a year. It loses its leaves each year.
Copy and paste the program code into part 2(c) in the evidence document.
[4]
(d) The main program calls ReadData(), stores the return value and calls PrintTrees() with
the first object in the returned array.
Copy and paste the program code into part 2(d)(i) in the evidence document.
[2]
Copy and paste the screenshot into part 2(d)(ii) in the evidence document.
[1]
The procedure prompts the user to input their requirements for a tree.
The user needs to enter:
• the tree’s maximum height is not more than the user’s input
and
• the tree’s maximum width is not more than the user’s input
and
The procedure creates a new array of all the Tree objects that meet all the requirements.
The procedure calls PrintTrees() for each Tree object that meets all the requirements. If
there are no trees that meet all the requirements, a suitable message is output.
Copy and paste the program code into part 2(e)(i) in the evidence document.
[6]
(ii) The procedure ChooseTree() needs amending. After the procedure has output the list
of trees that meet all the requirements, the procedure needs to:
• take as input the name of one of the trees that the user would like to buy from those
that meet all the requirements
• take as input the height of the tree in cm when it is bought
• calculate and output how many years it will take the tree to grow to its maximum
height.
For example, the user inputs the tree, Beech. The tree’s height is 40 cm when bought.
The tree will take 12 years to reach its maximum height of 400 cm.
Copy and paste the program code into part 2(e)(ii) in the evidence document.
[2]
(iii) Write program code to amend the main program to call ChooseTrees().
When asked for the tree selection, use the following data:
Copy and paste the screenshot into part 2(e)(iii) in the evidence document.
[2]
3 A program reads data from the user and stores the data that is valid in a linear queue.
The queue is stored as a global 1D array, QueueData, of string values. The array needs space for
20 elements.
The global variable QueueHead stores the index of the first element in the queue.
The global variable QueueTail stores the index of the last element in the queue.
(a) The main program initialises all the elements in QueueData to a suitable null value,
QueueHead to −1 and QueueTail to −1.
Copy and paste the program code into part 3(a) in the evidence document.
[1]
(b) The function Enqueue() takes the data to insert into the queue as a parameter.
If the queue is not full, it inserts the parameter in the queue, updates the appropriate pointer(s)
and returns TRUE. If the queue is full, it returns FALSE.
Copy and paste the program code into part 3(b) in the evidence document.
[4]
(c) The function Dequeue() returns "false" if the queue is empty. If the queue is not empty, it
returns the next item in the queue and updates the appropriate pointer(s).
Copy and paste the program code into part 3(c) in the evidence document.
[3]
(d) The string values to be stored in the queue are 7 characters long. The first 6 characters are
digits and the 7th character is a check digit. The check digit is calculated from the first 6 digits
using this algorithm:
Example:
Data is 954123
Character position 0 1 2 3 4 5
Digit 9 5 4 1 2 3
Multiplier 1 3 1 3 1 3
Product 9 15 4 3 2 9
Sum of products = 9 + 15 + 4 + 3 + 2 + 9 = 42
A 7‑character string is valid if the 7th character matches the check digit for that data. For
example, the data 9541235 is invalid because the 7th character (5) does not match the check
digit for 954123.
(i) The subroutine StoreItems() takes ten 7‑character strings as input from the user and
uses the check digit to validate each input.
Each valid input has the check digit removed and is stored in the queue using
Enqueue().
An appropriate message is output if the item is inserted. An appropriate message is
output if the queue is already full.
The subroutine counts and outputs the number of invalid items that were entered.
Copy and paste the program code into part 3(d)(i) in the evidence document.
[6]
• call StoreItems()
• call Dequeue()
• output a suitable message if the queue was empty
• output the returned value if the queue was not empty.
Copy and paste the program code into part 3(d)(ii) in the evidence document.
[1]
(iii) Test the program with the following inputs in the order given:
999999X
1251484
5500212
0033585
9845788
6666666
3258746
8111022
7568557
0012353
Copy and paste the screenshot into part 3(d)(iii) in the evidence document.
[2]
BLANK PAGE
BLANK PAGE
BLANK PAGE
Permission to reproduce items where third‑party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer‑related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge
Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.