Lesson 4.2.1.3
4.2.1.3 Reading and writing text and binary files Quiz: AQA Computer Science, Unit 2
20 questions
In partnership with Revision Ninja
Lesson 4.2.1.3, Reading and writing text and binary files: 20 multiple choice questions for the AQA Computer Science (7517), Unit 2: Fundamentals of data structures, written with Revision Ninja.
Host it live on the board and students join with a game code on their own devices, or revise alone with Free Play. The answers are revealed in the game.
The 20 questions
-
How is data stored in a binary file compared to a text file?
- ASCII text
- Raw bytes
- Formatted strings
- Unicode characters
-
What mode must a text file be opened in before reading its contents?
- Execute mode
- Write mode
- Read mode
- Append mode
-
Which file mode adds new data to the end of an existing text file without overwriting it?
- Append mode
- Read mode
- Update mode
- Write mode
-
What advantage does a binary file offer over a text file for storing numerical data?
- Automatic encryption
- No conversion needed
- Plain ASCII format
- Easy human editing
-
What signal is checked when reading a sequential text file to detect when data ends?
- Null terminator
- Stack overflow
- Buffer overrun
- End of file
-
In what order must fields in a binary record be read back from a file?
- Alphabetical order
- Exact written order
- Reverse written order
- Any random order
-
What is stored when a complete record is written to a file stream?
- Only primary keys
- Variable pointer addresses
- File metadata only
- All constituent fields
-
A text file contains 'Sam,42'. What type conversion is required to perform maths on the age?
- Integer to string
- Float to string
- String to integer
- String to boolean
-
In what order are records accessed when using sequential file access?
- Sorted key order
- Last to first
- First to last
- Random index order
-
What action ensures buffered output data is fully written to a file on secondary storage?
- Reading the file
- Closing the file
- Appending the file
- Opening the file
-
What check must precede opening a user-specified file?
- File existence
- Memory limit
- Type casting
- Syntax check
-
Which data structure is most suitable to store 100 integers read from a text file?
- Boolean array
- Single integer variable
- Integer array
- Character stack
-
Which access method reads file records one after another in the order they are stored?
- Hashed access
- Direct access
- Sequential access
- Random access
-
Which file access mode opens a text file to add data without overwriting existing content?
- Append mode
- Binary mode
- Read mode
- Write mode
-
If a binary record writes a string then an integer, in what order must they be read?
- String then integer
- Any order preferred
- Both simultaneously
- Integer then string
-
Which file mode parameter is used specifically for reading and writing binary files in Python?
- r+b
- append
- rt
- w+
-
What causes newly written file data to remain temporarily unreadable by other processes?
- File locking
- Buffered output
- Network latency
- Disk caching
-
What is a single data element contained within a record called?
- Field
- File
- Byte
- Key
-
Which file access method allows updating a record directly without reading preceding records?
- Direct access
- Serial access
- Sequential access
- Indexed access
-
Which data format is best stored using a binary file rather than a text file?
- Raw image data
- Plain text file
- HTML document
- CSV spreadsheet
Related quizzes
- Data structures and abstract data types Quiz · 4.2.1.1 · 20 questions
- Single- and multi-dimensional arrays Quiz · 4.2.1.2 · 20 questions
- Linear, circular and priority queues Quiz · 4.2.2.1 · 20 questions
- Stack operations Quiz · 4.2.3.1 · 20 questions
- Graphs: weighted, directed and adjacency representations Quiz · 4.2.4.1 · 20 questions
- Trees and binary trees Quiz · 4.2.5.1 · 20 questions
- Hash tables, hashing and collisions Quiz · 4.2.6.1 · 20 questions
- Dictionaries and key-value pairs Quiz · 4.2.7.1 · 20 questions
- Vectors and vector operations Quiz · 4.2.8.1 · 20 questions
- Data types Quiz · 4.1.1.1 · 20 questions