Question 10 2023 · May-June · Paper 33 · 5 marks
Reveal official mark-scheme answer
Official answer for Question 10
Question 5
Show text version of question
Question 10
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"
Why this question appears here
82% assigned-topic match · Programming › Constructs
Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.
Permanent source page: Educate A Change · From 9618_s23_qp_33.pdf
