Computer Science (AS & A Level) · May / June 2023 · Paper 31 · Question 10
9618
As printed in the paper
The question as text
The pseudocode algorithm shown copies an active accounts text file ActiveFile.txt to an archive accounts text file ArchiveFile.txt, one line at a time. Any blank lines found in the active accounts text file are replaced with the words "Account not present" in the archive accounts text file. Complete this file-handling pseudocode. DECLARE Account : STRING OPENFILE "ArchiveFile.txt" FOR WRITE WHILE NOT READFILE "ActiveFile.txt", Account IF Account = "" THEN WRITEFILE "ArchiveFile.txt", " " ELSE WRITEFILE "ArchiveFile.txt", ENDIF ENDWHILE CLOSEFILE "ArchiveFile.txt" [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.

