Note AcademyNote Academy

Computer Science (AS & A Level) · May / June 2025 · Paper 31 · Question 12

9618

As printed in the paper

The question as text

The pseudocode algorithm checks whether a location in a stock file StockList.dat is empty or not. The location is given by the user. If the location is empty, a suitable message is displayed, otherwise the item stored at that location is displayed. Complete this file-handling pseudocode algorithm. DECLARE Location : INTEGER DECLARE Item : STRING DECLARE Continue : BOOLEAN DECLARE Answer : CHAR Continue TRUE OPENFILE WHILE Continue OUTPUT "Enter a location between 1 and 500: " INPUT Location GETRECORD IF Item = "" THEN OUTPUT "This record is missing." ELSE OUTPUT "The item in stock is ", ENDIF OUTPUT "Another location (Y or N)?" INPUT Answer IF Answer <> 'Y' THEN Continue FALSE ENDIF ENDWHILE OUTPUT "End of program" [5]

Read automatically from the paper; the printed page above is exact.

Show the answer and mark scheme

Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.