Back to the full dot-point answer
Northern IrelandSoftware Systems DevelopmentQuick questions
AS 2 Event Driven Programming
Quick questions on File handling and persistence: reading and writing text files - CCEA A-Level Software Systems Development
4short Q&A pairs drawn directly from our worked dot-point answer. For full context and worked exam questions, read the parent dot-point page.
What is no end-of-file control on a read loop?Show answer
Reading past the end of a file causes an error. Control the read loop with an EOF test (or read until a sentinel), not a fixed count, since the number of lines is usually unknown.
What is q1?Show answer
State two reasons a file must be closed after it has been written to. [2 marks]
What is q2?Show answer
A program must add a new line to an existing file without deleting its contents. State the mode it should open the file in. [1 mark]
What is q3?Show answer
Name one error that can occur when opening a file to read, and state one way to handle it. [2 marks]
Have a question we have not covered?
This dot-point answer is short enough that we have not extracted many short questions yet. Read the full dot-point answer or ask Mo, our study assistant, in the chat for follow ups.