File Handling (Cambridge (CIE) IGCSE Computer Science): Exam Questions

Exam code: 0478 & 0984

18 mins6 questions
12 marks

State the two actions from the list below that a program needs to take to store data in a file.

  • activate

  • calculate

  • close

  • open

  • output

  • print

  • read

  • search

  • sort

  • write

25 marks

State five file-handling operations from the list below:

  • calculate

  • close

  • count

  • create

  • input

  • open

  • output

  • print

  • read

  • sort

  • search

  • test

  • total

  • write

32 marks

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

13 marks

Explain why a program might need to store data in a file

22 marks

A program halted unexpectedly with the error message ‘File not found’ whilst trying to read data from a file.

Outline the actions that the program needs to take to prevent this error occurring.

34 marks

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.