Professional Documents
Culture Documents
Y12 CS T2 W6 L1 Ch10 - Records - Files
Y12 CS T2 W6 L1 Ch10 - Records - Files
Y12 CS T2 W6 L1 Ch10 - Records - Files
8
Reading from a file
▪ Once a file has been opened, the data is read from it one line
at a time. The data can be read into a variable
Writing to a file
▪ Once the file is opened in WRITE or APPEND mode, it can be
written to a line at a time
9
End of file and Closing a file
10
11
Example code – Writing to a file
12
Example code – Writing to a file
13
Example code – Writing to a file
14
Reading the content of a file
Existing file
15
Task
Write a Pseudocode to
• open a file named MyFile
• Write few lines of text into the file and
• read the content from the file.
16
Task Answer
17
Past paper question
19
20
21
22
23
PLENARY
24
Plenary answer
25
IL TASK