Question 3(c)(i) 2018 · October-November · Paper 43 · 5 marks
Reveal official mark-scheme answer
Official answer for Question 3
Part (c)
(i)
Question 1
mark for each correct statement:
Question 5
Show text version of question
Question 3
Part (c)
(i)
Question 3
Joseph is taking a toy apart. Each time he removes an item from the toy, he writes the name of
the item at the bottom of a paper list. When he rebuilds the toy, he puts the items back together working from the bottom of the list.
Joseph writes a computer program to create the list using a stack, Parts.
DECLARE Parts : ARRAY[0 : 19] OF STRING
(i)
The procedure POP outputs the last element that has been pushed onto the stack and
replaces it with a '*'.
Complete the pseudocode for the procedure POP.
PROCEDURE POP
IF ………………………………. = ……………………………….
THEN
OUTPUT "The stack is empty"
ELSE
StackPointer …………………………………………
OUTPUT ……………………………….……………………………….
Parts[StackPointer] ……………………………….
ENDIF
ENDPROCEDURE
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 9608_w18_qp_43.pdf
