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.
1Describe5 marks
2026
A text file, members, stores three lines for each member of a club: surname, then town, then membership number. An algorithm must read members line by line and write only the surnames into a new text file, surnames.
Both files are currently closed.
Describe the steps this algorithm would follow.
Markscheme and model answer locked
Unlock Question2Explain3 marks
2026
Explain why a file should be closed after use.
Markscheme and model answer locked
Unlock Question3State2 marks
2026
State two modes in which a file can be opened.
Markscheme and model answer locked
Unlock Question4Describe5 marks
2027
A text file, contacts, holds four lines per person: name, phone, email and town. An algorithm writes only the email addresses into a new text file, emails. Both files are closed. Describe the steps the algorithm follows.
Markscheme and model answer locked
Unlock Question5Describe5 marks
2027
A text file, results, stores each pupil on two lines: name, then score. An algorithm copies only the names of pupils who scored over 50 into a new file, passed. Both files are closed. Describe the steps the algorithm follows.
Markscheme and model answer locked
Unlock Question6Explain4 marks
2026
Explain two advantages of storing data in a binary file rather than a text one.
Markscheme and model answer locked
Unlock Question7Determine2 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 Question8State1 mark
2026
State the three basic operations performed on a file.
Markscheme and model answer locked
Unlock Question9Distinguish3 marks
2026
Distinguish between a text file and a binary file.
Markscheme and model answer locked
Unlock Question10Distinguish3 marks
2026
Distinguish between reading a file sequentially and accessing it directly.
Markscheme and model answer locked
Unlock Question11Explain3 marks
2026
Explain why direct access requires fixed-length records.
Markscheme and model answer locked
Unlock Question12Determine2 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 Question13Determine2 marks
2026
Determine which record number begins at byte 48 000 in that same file.
Markscheme and model answer locked
Unlock Question14Explain4 marks
2026
Explain why a program should not assume a file it reads is correctly formatted.
Markscheme and model answer locked
Unlock Question15Choose1 mark
2026
Choose what opening a file in write mode does to existing contents.
Markscheme and model answer locked
Unlock Question16Choose1 mark
2026
Choose what direct access to a record requires.
Markscheme and model answer locked
Unlock Question17Suggest3 marks
2026
Suggest why a log file should be opened in append mode rather than write mode.
Markscheme and model answer locked
Unlock Question18Suggest3 marks
2026
Suggest why a comma-separated format causes problems for data containing commas.
Markscheme and model answer locked
Unlock Question19Explain4 marks
2026
Explain two advantages of storing data in a text file rather than a binary one.
Markscheme and model answer locked
Unlock Question20Construct3 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 QuestionReady 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