Question 8(d) 2023 · October-November · Paper 23 · 12 marks
Reveal official mark-scheme answer
Official answer for Question 8
Part (d)
Question 3
Show text version of question
Question 8
Part (d)
Question 8
Question 7
Part (b)
A module AddTo() will add a value to the queue by manipulating the array and variables in
part (a).
The queue implementation is circular. When pointers reach the end of the queue, they will ‘wrap around’ to the beginning.
Before a value can be added to the queue, it is necessary to check the queue is not full.
The algorithm to add a value to the queue is expressed in six steps.
Complete the steps.
1. If NumItems .............................. then jump to step 6.
2. Increment ................................... .
3. If ................................................. then set EndOfQueue to .............................. .
4. Increment ................................... .
5. Set the ............................ at the index stored in ........................... to the ............................ being added.
6. Stop.
Question 8
4 A procedure RandList() will output a sequence of 25 random integers, where each integer is larger than the previous one.
Part (d)
Module GetData() returns the data field from a message that has been received. If no
message is available, the module waits until one has been received.
Explain the limitation of this on module Chat() from part (c).
Describe a modification to GetData() to address this limitation.
Limitation ..................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Modification ..............................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
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.
Why this question appears here
71% assigned-topic match · Programming › Constructs
Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.
Permanent source page: Educate A Change · From 9618_w23_qp_23.pdf
