Skip to main content
A-LevelComputer ScienceData types and structures9618/31 · May/June 2023 · Q105 Marks

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"

  1. (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.

  1. [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 →

About this question

Topic
Data types and structures, A-Level Computer Science (syllabus 9618). Structured question, 5 marks.
Source
A-Level Computer Science, May/June 2023 Paper 3 Variant 1, question 10.

Questions and mark schemes are from past examination papers and remain the copyright of the exam board. How Oracle Prep builds its content

Related Computer Science questions

© 2026 Oracle Prep