Question 3(b)(ii) 2023 · May-June · Paper 41 · 3 marks
Reveal official mark-scheme answer
Official answer for Question 3
Part (b)
(ii)
Question 1
mark each
Question 3
Show text version of question
Question 3
Part (b)
(ii)
Question 3
A program implements two stacks using 1D arrays. One stack stores the names of colours. One
stack stores the names of animals.
(ii)
Study the pseudocode function PopAnimal():
FUNCTION PopAnimal() RETURNS STRING
DECLARE ReturnData : STRING
IF AnimalTopPointer = 0 THEN
RETURN ""
ELSE
ReturnData Animal[AnimalTopPointer - 1]
AnimalTopPointer AnimalTopPointer - 1
RETURN ReturnData
ENDIF
ENDFUNCTION
Write program code to declare the function PopAnimal()
Save your program.
Copy and paste the program code into part 3(b)(ii) in the evidence document.
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_s23_qp_41.pdf
