Unit 6: B2 Programming

Topic 6.5: File processing Questions

Practice 20 exam-style questions for IB Computer Science Topic 6.5. Review the question stems below, then unlock the full Question Bank to access markschemes, model answers, and AI grading.

1Distinguish3 marks
2026
Distinguish between reading a file sequentially and accessing it directly.
Markscheme and model answer locked
Unlock Question
2State1 mark
2026
State the three basic operations performed on a file.
Markscheme and model answer locked
Unlock Question
3Suggest3 marks
2026
Suggest why a log file should be opened in append mode rather than write mode.
Markscheme and model answer locked
Unlock Question
4Suggest3 marks
2026
Suggest why a comma-separated format causes problems for data containing commas.
Markscheme and model answer locked
Unlock Question
5Choose1 mark
2026
Choose what opening a file in write mode does to existing contents.
Markscheme and model answer locked
Unlock Question
6Explain3 marks
2026
Explain why direct access requires fixed-length records.
Markscheme and model answer locked
Unlock Question
7Explain4 marks
2026
Explain two advantages of storing data in a text file rather than a binary one.
Markscheme and model answer locked
Unlock Question
8Explain4 marks
2026
Explain why a program should not assume a file it reads is correctly formatted.
Markscheme and model answer locked
Unlock Question
9Construct3 marks
2026
Write a Java program that appends a new record to the end of a text file called records.txt without losing what is already there.
Markscheme and model answer locked
Unlock Question
10Choose1 mark
2026
Choose what direct access to a record requires.
Markscheme and model answer locked
Unlock Question
11Construct3 marks
2026
Write a Python program that appends a new record to the end of a text file called records.txt without losing what is already there.
Markscheme and model answer locked
Unlock Question
12Explain4 marks
2026
Explain why a program writing an important file should not write directly over the original.
Markscheme and model answer locked
Unlock Question
13Suggest3 marks
2026
Suggest why a program should check whether a file exists before opening it for reading.
Markscheme and model answer locked
Unlock Question
14Determine2 marks
2026
Determine which record number begins at byte 48 000 in that same file.
Markscheme and model answer locked
Unlock Question
15Explain4 marks
2026
Explain why a file must be closed after use.
Markscheme and model answer locked
Unlock Question
16Construct4 marks
2026
Write a Java program that reads every line of a text file called log.txt and outputs those containing the word 'error'.
Markscheme and model answer locked
Unlock Question
17Determine2 marks
2026
Determine the byte position of record 250 in a file of fixed-length 80-byte records, counting the first record as record 0.
Markscheme and model answer locked
Unlock Question
18Determine2 marks
2026
Determine the size of a file holding 5000 records of 120 bytes each, in megabytes. Take 1 MB as 1 000 000 bytes.
Markscheme and model answer locked
Unlock Question
19Explain4 marks
2026
Explain two advantages of storing data in a binary file rather than a text one.
Markscheme and model answer locked
Unlock Question
20Explain3 marks
2026
Explain what happens if a file is opened for writing when it already contains data.
Markscheme and model answer locked
Unlock Question

Ready to practice Topic 6.5?

Get instant AI feedback on your answers, view detailed markschemes, and track your progress across all IB Computer Science topics.

Start Practising Now