Outline why it is useful to store data in a file.
- (a)Outline why it is useful to store data in a file.[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.
- [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
- [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 →