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"
- Complete this file-handling pseudocode algorithm.[5]
Mark scheme
Marking points from the official mark scheme (May/June 2025). The mark or mark type is shown in brackets.
- [1] OPENFILE "StockList.dat" FOR RANDOM
- [1] SEEK "StockList.dat", Location
- [1] GETRECORD "StockList.dat", Item
- [1] OUTPUT "The item in stock is ", Item
- [1] CLOSEFILE "StockList.dat"
Write your answer and get it marked
On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.
Sign up free →