Year 11 Computer Science: File Handling and Logic Gates Worksheet

Computer Science
Year 11
11 questions
~22 mins
0 views0 downloads

About This Worksheet

This worksheet covers topics related to file handling in programming and understanding logic gates. Complete each question to demonstrate your knowledge and skills.

Worksheet Preview

Full preview • 11 questions

Year 11 Computer Science: File Handling and Logic Gates Worksheet

Subject: Computer ScienceGrade: Year 11
Name:
Date:
TeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizz

Untitled Worksheet

Grade Year 11
A

Questions

This worksheet covers topics related to file handling in programming and understanding logic gates. Complete each question to demonstrate your knowledge and skills.

Answer all questions in the spaces provided.
1.
Explain what a file mode 'r' signifies when opening a file in a programming language like Python.
[2 marks]
2.
Write a short code snippet in Python that opens a file called 'data.txt' for writing, writes the text 'Hello World', and then closes the file.
[4 marks]
3.
Describe what happens if you try to read from a file that has been opened in write-only mode.
[3 marks]
4.
Complete the truth table for the AND gate with inputs A and B, and output Q.
[4 marks]
ABOutput
00
01
10
11
5.
Draw the logic circuit for an OR gate using standard logic symbols. Label the inputs and output clearly.
[6 marks]
Drawing / Sketch space
6.
Sketch a truth table for a NOT gate with a single input A and output Q. The table should include all possible input-output combinations.
[4 marks]
Drawing / Sketch space
7.
A program needs to check if a user has entered the correct password. The program reads the input from a file. Describe the steps the program should take to verify the password stored in the file.
[5 marks]
8.
Complete the truth table for an XOR gate with inputs A and B, and output Q.
[4 marks]
ABOutput
00
01
10
11
9.
Draw a logic circuit that combines an AND gate and a NOT gate so that the output is true only when A is true and B is false. Label all inputs and the final output.
[6 marks]
Drawing / Sketch space
10.
Explain the difference between 'read' and 'write' modes when handling files in programming.
[3 marks]
11.
Describe what a 'file pointer' is and how it is used when reading from or writing to a file.
[4 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