Year 9 Programming and Logic Gates Worksheet
Computer Science
Year 9
11 questions
~22 mins
0 views0 downloads
About This Worksheet
This worksheet covers functions in programming and logic gates. Complete each task to demonstrate your understanding of these topics.
Worksheet Preview
Full preview • 11 questions
Year 9 Programming and Logic Gates Worksheet
Subject: Computer ScienceGrade: Year 9
Name:
Date:
TeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizz
Untitled Worksheet
Grade Year 9
A
Questions
This worksheet covers functions in programming and logic gates. Complete each task to demonstrate your understanding of these topics.
Answer all questions in the spaces provided.
1.
Write a simple Python function called 'greet' that takes a name as input and returns a greeting message in the format 'Hello, [Name]!'
[4 marks]2.
Describe in your own words what a function is in programming and why it is useful.
[3 marks]3.
Complete the following Python function so that it returns the square of a number:
[3 marks]4.
A logic circuit has two inputs, A and B. Draw a logic circuit diagram using AND, OR, and NOT gates to produce an output that is true only when exactly one input is true.
[6 marks]| A | Output |
|---|---|
| 0 | |
| 1 |
5.
Using a truth table, complete the table for an OR gate with inputs A and B and output C.
[5 marks]| A | B | Output |
|---|---|---|
| 0 | 0 | |
| 0 | 1 | |
| 1 | 0 | |
| 1 | 1 |
6.
Draw the logic circuit diagram for an AND gate with two inputs.
[4 marks]Drawing / Sketch space
7.
Explain how a function can be used to make a program more efficient with an example.
[4 marks]8.
Identify the logic gate that outputs true only when both inputs are true. Describe its symbol and how it works.
[3 marks]| A | B | Output |
|---|---|---|
| 0 | 0 | |
| 0 | 1 | |
| 1 | 0 | |
| 1 | 1 |
9.
Sketch a flowchart for a program that asks a user for their age and outputs whether they are a minor or an adult.
[6 marks]Drawing / Sketch space
10.
Describe the difference between a function and a procedure in programming.
[3 marks]11.
Draw the truth table for a NAND gate with two inputs.
[5 marks]Drawing / Sketch space
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