Question 2(b) 2023 · May-June · Paper 42 · 4 marks
Reveal official mark-scheme answer
Official answer for Question 2
Part (b)
Question 1
mark each
Question 4
Show text version of question
Question 2
Part (b)
Question 2
A business sells a single product. Customers can purchase one or more of this product.
Each sale has an ID and a quantity, for example "ABC" and 2
The business needs a program to store the data about the sales in a circular queue data structure.
Part (b)
Write program code to:
- declare a global array, CircularQueue, of 5 items to store the sale records
- declare the global pointers Head and Tail
- declare the global variable NumberOfItems
- initialise all elements of the array CircularQueue to an empty record, where the ID is
- initialise Head, Tail and NumberOfItems to 0
null ("") and quantity is -1
Save your program.
Copy and paste the program code into part 2(b) in the evidence document.
Why this question appears here
82% assigned-topic match · Data types and structures › Data types and records
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_s23_qp_42.pdf
