Past-paper question · 2018 October-November · Paper 43 · Q3(c)(i)

Question 3(c)(i) 2018 · October-November · Paper 43 · 5 marks

Original past-paper question for 3(C)(I)
Original past-paper question for 3(C)(I)
Original past-paper question for 3(C)(I)
Original past-paper question for 3(C)(I)
Reveal official mark-scheme answer Official mark-scheme answer for 3(C)(I)

Official answer for Question 3

Part (c)

(i)

Question 1

mark for each correct statement:

Question 5

✓
PROCEDURE POP
✓
IF StackPointer = 0
✓
THEN
✓
OUTPUT ("The stack is empty")
✓
ELSE
✓
StackPointer ← StackPointer - 1
✓
OUTPUT Parts[StackPointer]
✓
Parts(StackPointer) ← "*"
✓
ENDIF
✓
ENDPROCEDURE

Mark scheme 9608_w18_ms_43.pdf →

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.

A
1D array, Parts, is used to implement the stack. Parts is declared as:

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

[5]
Topic relevance

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

Keep practising this topic