Past-paper question · 2025 May-June · Paper 33 · Q11

Question 11 2025 · May-June · Paper 33 · 5 marks

Original past-paper question for 11
Reveal official mark-scheme answer Official mark-scheme answer for 11

Official answer for Question 11

✓
One mark for each correctly completed line

Question 5

✓
DECLARE Location : INTEGER
✓
DECLARE NewStock : STRING
✓
DECLARE CurrentStock : STRING
✓
DECLARE Stored : BOOLEAN
✓
DECLARE Max : INTEGER
✓
Stored FALSE
✓
Location 1
✓
OPENFILE "StockList.dat" FOR RANDOM
✓
OUTPUT "Enter the new item you wish to store"
✓
INPUT NewStock
✓
WHILE NOT Stored AND Location <= Max
✓
SEEK "StockList.dat", Location
✓
GETRECORD "StockList.dat", CurrentStock
✓
IF CurrentStock = "" THEN
✓
PUTRECORD "StockList.dat", NewStock
✓
Stored TRUE
✓
ELSE
✓
Location Location + 1
✓
ENDIF
✓
ENDWHILE
✓
IF Stored = FALSE THEN
✓
OUTPUT "The new stock item has not been stored as the file was full"
✓
ENDIF
✓
CLOSEFILE "StockList.dat"
✓
9618/33
✓
Cambridge International AS & A Level – Mark Scheme
✓
May/June 2025
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks

Mark scheme 9618_s25_ms_33.pdf →

Show text version of question

Question 11

The pseudocode algorithm below allows a user to input a new stock item. The random file is searched for the next empty location in the file and the new item is inserted there.

A
suitable message is displayed if the file is full.

Complete this pseudocode.

DECLARE Location : INTEGER DECLARE NewStock : STRING DECLARE CurrentStock : STRING DECLARE Stored : BOOLEAN DECLARE Max : INTEGER ←

Max 100000 Stored FALSE← Location 1 ← .......................................................................................................................................................... OUTPUT "Enter the new item you wish to store: " INPUT NewStock WHILE NOT Stored AND Location <= Max

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

GETRECORD "StockList.dat", ..........................................................................................

IF CurrentStock = "" THEN

...................................................................................... "StockList.dat", NewStock Stored ← TRUE ELSE Location ← Location + 1 ENDIF ENDWHILE

................................................................................................................................................ THEN OUTPUT "The new item has not been stored as the file was full." ENDIF CLOSEFILE "StockList.dat"

[5]

Question 14

, ,

Topic relevance

Why this question appears here

72% assigned-topic match · Data types and structures › Data types and records

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

Keep practising this topic