← All printables
IGCSE Computer Science Paper 2 · Modules 489–499

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

A free printable IGCSE Computer Science Paper 2 definitions worksheet with 9 key terms, built from the key terms of 8.3 File Handling (Modules 489–499) — WRITEFILE: writing a single item of data, WRITEFILE: writing a line of text, CLOSEFILE, Why a file must be closed, OPENFILE ... FOR READ, READFILE: reading a single item of data and more. Print it or save it as a PDF — the answer key starts on its own page. No login needed.

IGCSE Computer Science Paper 2 Definitions Worksheet: 8.3 File Handling (Modules 489–499)

Name:
Date:
Class:

Key terms

Write what each term means, in your own words.

1
WRITEFILE "Scores.txt", Score
2
WRITEFILE "Names.txt", LineOfText
3
CLOSEFILE "Scores.txt"
4
CLOSEFILE
5
OPENFILE "Scores.txt" FOR READ
6
READFILE "Scores.txt", Score
7
READFILE "Names.txt", LineOfText
8
DECLARE LineOfText : STRING
9
FOR Count ← 1 TO 5

Answer Key

IGCSE Computer Science Paper 2 · Modules 489–499 · Student wording will vary for definitions
1WRITEFILE "Scores.txt", Score — Writes the value stored in a variable into an open file. Give the file name, a comma, then the variable. The file must already be open in WRITE mode.
2WRITEFILE "Names.txt", LineOfText — Writes the text held in the STRING variable LineOfText into the file Names.txt as one new line. Each WRITEFILE adds one more line to the file.
3CLOSEFILE "Scores.txt" — Closes the file named in the identifier once you have finished reading or writing, so data is saved and the file is released. The name must match the one used in OPENFILE.
4CLOSEFILE — Closes an open file so its data is safely saved and the file can be opened again in a different mode, such as READ after WRITE. Use one CLOSEFILE for each OPENFILE.
5OPENFILE "Scores.txt" FOR READ — Opens the existing file Scores.txt in READ mode so the program can read data from it with READFILE. The file must already exist, and READ mode does not change its contents.
6READFILE "Scores.txt", Score — Reads one data item from the open file and stores it in the variable. The file must already be open in READ mode, and the variable's data type must match the item.
7READFILE "Names.txt", LineOfText — Reads the next line of text from the open file Names.txt into the STRING variable LineOfText. Each READFILE call reads the following line. Declare the variable first.
8DECLARE LineOfText : STRING — The variable used with READFILE or WRITEFILE needs a data type that suits the data: STRING for a line of text, INTEGER for a whole number. A wrong type causes errors.
9FOR Count ← 1 TO 5 — A FOR loop with INPUT and WRITEFILE inside repeats a fixed number of times, writing one item to the open file on each repeat. CLOSEFILE goes after NEXT.

Modules this definitions worksheet covers

Every module has its own free printable worksheet with an answer key, and students can practise the same terms interactively on Cloodit.

Part of: IGCSE Computer Science 0478 — 8.3 File Handling

More IGCSE Computer Science Paper 2 printables

This printable is free — no login needed.

Free classroom tools, no account: Hangman · Random Team Generator · Random Name Picker Wheel · Seating Plan Maker

Make a free class, give it a journey, and you also get:

Create a free teacher account →

No credit card. No setup fee. Make a class and invite students in under three minutes.