Year 9 Computer Science: File Handling and Logic Gates
Computer Science
Year 9
10 questions
~20 mins
0 views0 downloads
About This Worksheet
This worksheet covers file handling concepts and basic logic gates. Read each question carefully and answer to the best of your ability.
Worksheet Preview
Full preview • 10 questions
Year 9 Computer Science: File Handling and Logic Gates
Subject: Computer ScienceGrade: Year 9
Name:
Date:
TeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizz
Untitled Worksheet
Grade Year 9
A
Questions
This worksheet covers file handling concepts and basic logic gates. Read each question carefully and answer to the best of your ability.
Answer all questions in the spaces provided.
1.
Explain the difference between opening a file in 'read' mode and 'write' mode in programming.
[4 marks]2.
Describe what happens when a program tries to read from a file that does not exist.
[3 marks]3.
Write a simple pseudocode snippet that opens a file named 'data.txt', reads its contents, and then closes the file.
[5 marks]4.
List three types of data that can be stored in a file.
[3 marks]5.
Complete the truth table for the AND logic gate with inputs A and B, and output C.
[4 marks]| A | B | Output |
|---|---|---|
| 0 | 0 | |
| 0 | 1 | |
| 1 | 0 | |
| 1 | 1 |
6.
Complete the truth table for the OR logic gate with inputs A and B, and output C.
[4 marks]| A | B | Output |
|---|---|---|
| 0 | 0 | |
| 0 | 1 | |
| 1 | 0 | |
| 1 | 1 |
7.
Draw a logic circuit that uses an AND gate and an OR gate to produce an output that is high only when either both inputs are high or both are low. Label all inputs and outputs clearly.
[8 marks]Drawing / Sketch space
8.
Sketch a flowchart demonstrating the process of opening a file, reading data, and closing the file in a programming context.
[8 marks]Drawing / Sketch space
9.
Describe a scenario where file handling could be used in a real-world application.
[4 marks]10.
In your own words, explain why it is important to close a file after opening it in a program.
[3 marks]Quick Actions
What is Remix?
Create a new worksheet based on this one. Change the grade level, topic, number of questions, or difficulty - then generate a fresh version.
- • Change grade level (Grade 6 → Grade 7)
- • Swap topics (Harry Potter → Macbeth)
- • Add more questions (10 → 15)
- • Adjust difficulty
Details
- Created
- 1/2/2026
- Updated
- 1/2/2026
- Type
- worksheet