Computing
Computer Science LearnITWithMrC ⛯ Year 7 Year 8 Year 9 GCSE
Responsive image

Lesson Video

28

Lesson Tasks

  • Watch the Lesson video
    Make notes if needed.
  • Open your Learning Journal
    Complete Task 1 in your Learning Journal
  • Complete the learning activities
    Make sure you complete the book tasks in your Unit Booklet
  • Complete End of Task Assessment
    Update your learning objectives

What do I need to Learn?

0 results forGuest
I need to learn how to understand the concept of subroutines.
I need to learn how to explain the advantages of using subroutines in programs.
I need to learn how to describe the use of parameters to pass data within programs.

Key Terms

Procedure Subroutines Identifier Parameters local variable global variable scope

Task 1 - Getting organised Click to see more


Task: Learning Journal

Open your Learning Journal by clicking on the image below

Good notes will help you organise and process data and information

Task 1: Fill out your learning Journal.

Open your Learning Journal and complete the task below .


Task 2 - Introducing Subroutines Click to see more

Key word - Subroutine

A Subroutine is a reusable sequence of instructions that perform a specific task


  • In computer science, a Subroutine is a programming structure that can be used over and over again.
  • Subroutines are sequences of instructions that perform a specific task. It may return one or more values, but does not have to. It may be easier to think of them as mini-programs within a large program.
  • We are going to look at a simple Subroutine that prints a greeting.


    Task: A simple Subroutine

  • Open Python Thonny
  • Save your file as 'a simple subroutine'


  • Copy the code from the image above and run it.
  • Then choose one of the three challenges below to complete.
    1. Can you put a loop in your simple Subroutine so it prints out your greeting 3 times
    2. Change the Subroutine so it asks the user a question then prints out a response
    3. Change the Subroutine so that it repeatedly asks the user a question until it gets a specific answer.

  • When you are finished screenshot your code into your Learning Journal


  • Task 3 - Subroutines with parameters Click to see more

    Key word - Parameter

    A Parameter is a variable that is 'passed' to a subroutine

    We can pass information to our procedure through parameters.

    The terms parameter and argument are sometimes used interchangeably. However, parameter refers to the type and identifier, and arguments are the values passed to the function.

    Below you can see our procedure has a single parameter called 'name' which we use to say hello to a person.


  • Run the code above with the three different arguments and see what happens

  • Task: Using Parameters

  • Open Python Thonny
  • Save your file as 'a simple subroutine2'


  • Copy the code from the image above and run it.
  • Then try the challenges below.
    1. Change the Subroutine so it gets the username from an input and then prints the name
    2. Add a second parameter to our Subroutine called age and then print out both the username and age.

  • When you are finished screenshot your code into your Learning Journal


  • Task 4 - Describe Explain Click to see more

    Task: Review

  • Open your PowerPoint at Task 4

  • Complete the Describe and explain task above
  • Then try the extension task below
    1. Create a subroutine using pseudocode to complete the following task
    • Ask a USER to input two numbers
    • Passes those numbers to a subroutine called add
    • Displays the sum of those two numbers to the screen

    Write your answer in the extension slide (see below)



    Task 5 - Lesson Review/Homework Click to see more


    Summing it all up

    Lets look at the learning outcomes and decide which one best describes our current level of understanding :

    Tick the one you feel is closest to your level

    Learning Outcomes

    • I have a basic understanding of how with a little help from my teacher
    • I can show my teacher that without their help.
    • independently and I can also explain it to others and can complete any extension tasks I am given.

    🠜 Now update your learning objectivesClick on the Assessment image


    Task 6 - Homework Click to see more


    Complete any unfinished tasks