Question 1(c) 2025 · May-June · Paper 42 · 4 marks
Reveal official mark-scheme answer

Official answer for Question 1
Part (c)
Question 1
mark each
Question 4
- Function header (and end where appropriate) and returning a value in all cases.
- Checking if stack is empty and returning string "–1"
- (Otherwise) Decrementing TopOfStack
- Returning element in stack at TopOfStack before TopOfStack is decremented
Show text version of question
Question 1
Part (c)
Question 1
A program reads data from a text file and stores it in a stack. The stack Stack is stored as a 1D
array of up to 20 elements. The pointer TopOfStack stores the index of the last element stored in the stack.
Part (c)
The function Pop() returns the next item from the stack.
The function returns "–1" if the stack is empty.
Write program code for Pop()
Save your program.
Copy and paste the program code into part 1(c) in the evidence document.
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_s25_qp_42.pdf
