Question 1(b) 2025 · May-June · Paper 41 · 6 marks
Reveal official mark-scheme answer


Official answer for Question 1
Part (b)
Question 1
mark each
Question 6
- Function header (and close) taking 1 (integer) parameter and returning a Boolean value in all cases
- Checking if queue is full (NumberItems = 20) and returning FALSE
- Checking if queue is empty (NumberItems = 0) then and updating TailPointer and HeadPointer appropriately
- Incrementing TailPointer and NumberItems in appropriate place …
- … looping back to 0 for TailPointer if at end of structure
- Storing parameter in Queue[TailPointer] (after increment) and returning TRUE
Show text version of question
Question 1
Part (b)
Question 1
A program stores positive integers in a circular queue.
The queue is stored as a global 1D array of 20 integers with the identifier Queue. Each index is initialised with the data –1
The global variable HeadPointer, initialised to –1, points to the first element in the queue. The global variable TailPointer, initialised to –1, points to the last element in the queue. The global variable NumberItems, initialised to 0, stores the number of items in the queue.
Part (b)
The function Enqueue():
- takes an integer as a parameter
- checks if the queue is full
- returns FALSE if the queue is full
- stores the parameter in the next position in the queue and returns TRUE if the queue is
- updates the appropriate pointers and NumberItems
not full
Write program code for Enqueue()
Save your program.
Copy and paste the program code into part 1(b) in the evidence document.
Question 3
Why this question appears here
82% assigned-topic match · Programming › Structured programming
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_s25_qp_41.pdf
