Computer Science · May / June 2026 · Paper 22 · Question 7
0478
As printed in the paper
Show the answer and mark scheme
7(a)[1]
One from:
So the data is stored permanently // provides a non-volatile copySo the data is not lost if the machine/program is switched off/crashesSo the data can be used again later // to provide a backupSo the data can be transported to a different (offline) computer // so the data can be shared7(b)[4]
One mark each
Declaration of an appropriately named variableCorrect statement to open Names.txt for readingCorrect statement to read data from the file into a variableCorrect statement to close Names.txtFor example:
DECLARE Name : STRING
OPENFILE "Names.txt" FOR READ
READFILE "Names.txt", Name
CLOSEFILE "Names.txt"
Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.

