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.

Host this setFree Play

The 20 questions

  1. How is data stored in a binary file compared to a text file?

    • ASCII text
    • Raw bytes
    • Formatted strings
    • Unicode characters
  2. What mode must a text file be opened in before reading its contents?

    • Execute mode
    • Write mode
    • Read mode
    • Append mode
  3. 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
  4. 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
  5. What signal is checked when reading a sequential text file to detect when data ends?

    • Null terminator
    • Stack overflow
    • Buffer overrun
    • End of file
  6. 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
  7. 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
  8. 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
  9. In what order are records accessed when using sequential file access?

    • Sorted key order
    • Last to first
    • First to last
    • Random index order
  10. 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
  11. What check must precede opening a user-specified file?

    • File existence
    • Memory limit
    • Type casting
    • Syntax check
  12. Which data structure is most suitable to store 100 integers read from a text file?

    • Boolean array
    • Single integer variable
    • Integer array
    • Character stack
  13. Which access method reads file records one after another in the order they are stored?

    • Hashed access
    • Direct access
    • Sequential access
    • Random access
  14. Which file access mode opens a text file to add data without overwriting existing content?

    • Append mode
    • Binary mode
    • Read mode
    • Write mode
  15. 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
  16. Which file mode parameter is used specifically for reading and writing binary files in Python?

    • r+b
    • append
    • rt
    • w+
  17. What causes newly written file data to remain temporarily unreadable by other processes?

    • File locking
    • Buffered output
    • Network latency
    • Disk caching
  18. What is a single data element contained within a record called?

    • Field
    • File
    • Byte
    • Key
  19. Which file access method allows updating a record directly without reading preceding records?

    • Direct access
    • Serial access
    • Sequential access
    • Indexed access
  20. 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

All AQA Computer Science quizzes