Year 10 Programming: Functions and Logic Gates Worksheet

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

About This Worksheet

This worksheet tests your understanding of programming functions and basic logic gates. Complete each question to demonstrate your knowledge.

Worksheet Preview

Full preview • 11 questions

Year 10 Programming: Functions and Logic Gates Worksheet

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

Untitled Worksheet

Grade Year 10
A

Questions

This worksheet tests your understanding of programming functions and basic logic gates. Complete each question to demonstrate your knowledge.

Answer all questions in the spaces provided.
1.
Write a simple Python function named 'add_numbers' that takes two numbers as parameters and returns their sum.
[4 marks]
2.
Describe what a function is in programming and explain its purpose in your own words.
[3 marks]
3.
Given the following pseudocode, what will be the output if the input is 5? function square(num): return num * num print(square(5))
[3 marks]
4.
Complete the following truth table for the AND logic gate: | Input A | Input B | Output | |---------|---------|---------| | | | | | | | |
[4 marks]
ABOutput
00
01
10
11
5.
Draw a logic circuit diagram for an OR gate with two inputs and one output. Label all parts clearly.
[5 marks]
Drawing / Sketch space
6.
Explain the difference between a function and a procedure in programming.
[3 marks]
7.
Sketch a flowchart that shows the process of checking if a number is positive, negative, or zero. Use decision symbols and process symbols clearly.
[6 marks]
Drawing / Sketch space
8.
Complete the truth table for the NAND gate: | Input A | Input B | Output | |---------|---------|---------| | | | | | | | |
[4 marks]
ABOutput
00
01
10
11
9.
Write a function in Python that takes a number as input and returns 'Positive' if the number is greater than zero, 'Negative' if less than zero, or 'Zero' if it equals zero.
[6 marks]
10.
Describe a real-life scenario where a function can be useful in programming.
[3 marks]
11.
Draw a truth table for the XOR (exclusive OR) gate with two inputs. Label the inputs and output clearly.
[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