Past-paper question · 2023 May-June · Paper 33 · Q10

Question 10 2023 · May-June · Paper 33 · 5 marks

Original past-paper question for 10
Reveal official mark-scheme answer Official mark-scheme answer for 10

Official answer for Question 10

✓
One mark for each correctly completed line (Max 5)

Question 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"
✓
Question
✓
Answer
✓
Marks

Mark scheme 9618_s23_ms_33.pdf →

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"

[5]
Topic relevance

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

Keep practising this topic