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"
- (a)Complete this file-handling pseudocode.[5]
Mark scheme
Marking points from the official mark scheme (May/June 2023). The mark or mark type is shown in brackets.
- [5] One mark for each correctly completed line (Max 5) DECLARE Account : STRING OPENFILE "ActiveFile.txt" FOR READ OPENFILE "ArchiveFile.txt" FOR WRITE WHILE NOT EOF("ActiveFile.txt") READFILE "ActiveFile.txt", Account IF Account = "" THEN WRITEFILE "ArchiveFile.txt", "Account not present" ELSE WRITEFILE "ArchiveFile.txt", Account ENDIF ENDWHILE CLOSEFILE "ActiveFile.txt" CLOSEFILE "ArchiveFile.txt"
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 →