Cambridge International AS & A Level: Computer Science 9618/23
Cambridge International AS & A Level: Computer Science 9618/23
com
¬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 * www.dynamicpapers.com
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 * www.dynamicpapers.com
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 * www.dynamicpapers.com
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
* 0019655333805 * www.dynamicpapers.com
DO NOT WRITE IN THIS MARGIN
5
, ,
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
ĬÏĊ¾Ġ³íÇ÷Íñ½Ğ¶õ×ð×
© UCLES 2024 ĬĖĜäÁĩÆÔÔăąĬúÙ¾ôÝĂ
ĥĕåÕµµåõąåõÕĥÕąĥõÕ
9618/23/M/J/24 [Turn over
* 0019655333806 * www.dynamicpapers.com
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 * www.dynamicpapers.com
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 * www.dynamicpapers.com
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 * www.dynamicpapers.com
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 * www.dynamicpapers.com
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
* 0019655333811 * www.dynamicpapers.com
DO NOT WRITE IN THIS MARGIN
11
, ,
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
ĬÓĊ¾Ġ³íÇ÷Íñ½Ğ¸÷Øî×
© UCLES 2024 ĬĖĚáÇīØÉáāø´ØÿĩôÍĂ
ĥåµĕõĕąõąÕåĕĥõąåąÕ
9618/23/M/J/24 [Turn over
* 0019655333812 * www.dynamicpapers.com
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 * www.dynamicpapers.com
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 * www.dynamicpapers.com
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [1]
ĬÍĉ¿Ġ³íÇ÷Íñ½Ğ¶öÕò×
© UCLES 2024 ĬĖęäÉĤêÒ×ČĈãġº¿ĤÕĂ
ĥąÅĕõÕĥĕĥĥõÕåõąåõÕ
9618/23/M/J/24
* 0019655333915 * www.dynamicpapers.com
DO NOT WRITE IN THIS MARGIN
15
, ,
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
ĬÏĉ¿Ġ³íÇ÷Íñ½Ğ¶øÕò×
© UCLES 2024 ĬĖĚãÁĦæââîùĦµÂěĤåĂ
ĥąµÕµµąõõĕåÕåĕĥĥĥÕ
9618/23/M/J/24 [Turn over
* 0019655333916 * www.dynamicpapers.com
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 * www.dynamicpapers.com
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 * www.dynamicpapers.com
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 * www.dynamicpapers.com
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 * www.dynamicpapers.com
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 * www.dynamicpapers.com
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
* 0019655333922 * www.dynamicpapers.com
BLANK PAGE
ĬÑĉ¿Ġ³íÇ÷Íñ½Ğ¶øÖò×
© UCLES 2024 ĬĖĜãÇĞÆ®èòăµ¹¼ĎôÝĂ
ĥąõĕµĕåÕĕÅąĕĥµÅåąÕ
9618/23/M/J/24
* 0019655333923 * www.dynamicpapers.com
DO NOT WRITE IN THIS MARGIN
23
, ,
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
ĬÓĉ¿Ġ³íÇ÷Íñ½Ğ¶öÖò×
© UCLES 2024 ĬĖěä¿ĬʾÑĈîôĝÄÊôÍĂ
ĥąąÕõõŵąµÕĕĥÕåĥĕÕ
9618/23/M/J/24
* 0019655333924 * www.dynamicpapers.com
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