Past-paper question · 2023 May-June · Paper 23 · Q3(b)(ii)

Question 3(b)(ii) 2023 · May-June · Paper 23 · 5 marks

Original past-paper question for 3(B)(II)
Original past-paper question for 3(B)(II)
Original past-paper question for 3(B)(II)
Reveal official mark-scheme answer Official mark-scheme answer for 3(B)(II)

Official answer for Question 3

Part (b)

(ii)

Question 5

✓
MP1
✓
Open the text file in WRITE mode
✓
MP2
✓
Check there is a value on the stack
✓
MP3
✓
POP value ….
✓
MP4
✓
Write value to the text file
✓
MP5
✓
Repeat from Step 2 // loop referencing the stack items
✓
Alternative solution: Not using POP primitive
✓
MP1
✓
Open the text file in WRITE mode
✓
MP2
✓
Check there is a value on the stack
✓
MP3
✓
Read value from ToS location
✓
MP4
✓
Write the value to the text file – Must some attempt at ‘the value’
✓
MP5
✓
Decrement ToS
✓
MP6
✓
Repeat from step 2 // loop referencing the stack items
✓
9618/23
✓
Cambridge International AS & A Level – Mark Scheme
✓
May/June 2023
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks

Mark scheme 9618_s23_ms_23.pdf →

Show text version of question

Question 3

Part (b)

(ii)

Question 3

A program processes data using a stack. The data is copied to a text file before the program ends.

The data is copied to a text file before the program ends.

(ii)

A module SaveStack() will write the data from the stack to a text file.

Express an algorithm for SaveStack() as five steps that could be used to produce pseudocode.

Write the five steps.

Step 1 ................................................................................................................................

...........................................................................................................................................

Step 2 ................................................................................................................................

...........................................................................................................................................

Step 3 ................................................................................................................................

...........................................................................................................................................

Step 4 ................................................................................................................................

...........................................................................................................................................

Step 5 ................................................................................................................................

...........................................................................................................................................

[5]

Question 8

Topic relevance

Why this question appears here

71% assigned-topic match · Algorithm design and problem-solving › Algorithms

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_23.pdf

Keep practising this topic