Question 11 2025 · May-June · Paper 33 · 5 marks
Reveal official mark-scheme answer
Official answer for Question 11
Question 5
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.
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"
Question 14
, ,
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
