Year 7 Programming and Logic Gates Worksheet

Computer Science
Year 7
10 questions
~20 mins
0 views0 downloads

About This Worksheet

This worksheet focuses on understanding functions in programming and basic logic gates. Complete the questions to improve your problem-solving skills.

Worksheet Preview

Full preview • 10 questions

Year 7 Programming and Logic Gates Worksheet

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

Untitled Worksheet

Grade Year 7
A

Questions

This worksheet focuses on understanding functions in programming and basic logic gates. Complete the questions to improve your problem-solving skills.

Answer all questions in the spaces provided.
1.
Write a simple Python function named 'addNumbers' that takes two numbers as inputs and returns their sum.
[4 marks]
2.
Describe what a function is in programming and give one example of when you might use one.
[3 marks]
3.
Complete the following pseudocode to create a function that checks if a number is even. The function should return 'Yes' if even, and 'No' if odd: FUNCTION checkEven(number) IF ________ RETURN 'Yes' ELSE RETURN 'No' END FUNCTION
[3 marks]
4.
Draw a logic circuit that represents the AND gate using two inputs and one output. Label the inputs as A and B, and the output as C.
[5 marks]
Drawing / Sketch space
5.
Complete the truth table for an OR gate with inputs A and B and output C.
[4 marks]
ABOutput
00
01
10
11
6.
A circuit contains two switches connected in series, and a light bulb. Describe how the switches need to be turned on or off for the light to turn on.
[3 marks]
7.
Draw a NOT gate and label the input as A and the output as B. Describe what the output B will be if the input A is true.
[5 marks]
Drawing / Sketch space
8.
Explain how a function differs from a loop in programming.
[3 marks]
9.
Sketch a flowchart that shows the decision process for a program that checks if a number is positive, negative, or zero.
[6 marks]
Drawing / Sketch space
10.
What will be the output of the following code snippet? ```python def multiplyByTwo(n): return n * 2 result = multiplyByTwo(5) print(result) ```
[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