Skip to main content
O-LevelComputer ScienceProgramming2210/21 · May/June 2024 · Q76 Marks

Outline why it is useful to store data in a file.

  1. (a)Outline why it is useful to store data in a file.[2]
  2. (b)The function LENGTH (X) calculates the length of a string X Write the pseudocode statements to: • read the contents of the text file Quotation.txt into an appropriate string variable that has been declared • output the string in upper case and the length of the string.[4]

Mark scheme

Marking points from the official mark scheme (May/June 2024). The mark or mark type is shown in brackets.

  1. [2] (a) One mark per mark point, max two • Data stored in a file gives a permanent copy / prevents the data from being lost • so it can be recalled / used again in a program / in another program • can be stored elsewhere / transferred to another computer
  2. [4] (b) One mark per mark point, max four MP1 Declaration of a string variable MP2 Correct use of OPENFILE keywords for reading MP3 Correct use READFILE with string variable MP4 Correct use of UCASE and LENGTH functions and output of each MP5 Correct use of CLOSEFILE Example: DECLARE Words : STRING OPENFILE Quotation.txt FOR READ READFILE Quotation.txt, Words OUTPUT UCASE (Words), LENGTH(Words) CLOSEFILE Quotation.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
Programming, O-Level Computer Science (syllabus 2210). Structured question, 6 marks.
Source
O-Level Computer Science, May/June 2024 Paper 2 Variant 1, question 7.

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