Question 2(e)(i) 2016 · May-June · Paper 33 · 4 marks
Reveal official mark-scheme answer
Official answer for Question 2
Part (e)
(i)
Part (e)
(i)
PROCEDURE Push(NewItem : STRING) [4]
Show text version of question
Question 2
Part (e)
(i)
It is suggested that the stack could be implemented using object-oriented programming.
(i)
Complete the pseudocode.
CLASS StackClass
PRIVATE
TOS : INTEGER
Stack : ARRAY[1 : 20] OF STRING
PUBLIC
PROCEDURE InitialiseStack
<statements>
ENDPROCEDURE
PROCEDURE Push(NewItem : STRING)
IF .................................................................................................................
THEN
OUTPUT " ....................................................................................... "
ELSE
TOS ...........................................................................................
............................................................ NewItem
ENDIF
ENDPROCEDURE
FUNCTION Pop
<statements>
ENDFUNCTION
ENDCLASS
Question 7
Why this question appears here
98% assigned-topic match · Further programming › Programming paradigms
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 9691_s16_qp_33.pdf
