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

Subroutines

What am I Learning today?

I have completed the assessment for Term 2

Knowledge Organiser

×

Lesson

Task 1 - Staying Organised Click to see more

  • We are saving all of of our work for this topic into a PowerPoint, that we started two weeks ago.

  • You have two options

    1. If you were here last week or the week beofre then open the PowerPoint that you saved your work into and add a new slide for Lesson 4.


Don't for get to create a lesson 4 button on the menu page and add a hyperlink to it!


Task 2 - Reviewing last lesson Click to see more


Load up your Automatic Home program from the last lesson. Let’s look at what you did with the different inputs and outputs.



Task 3 - Subroutines Click to see more

Subroutines

In computer programming, a subroutine is a sequence of program instructions that perform a specific task, packaged as a unit. This unit can then be used in programs wherever that particular task should be performed.


A 'Flash' subroutine

lighthouse mimic

Below is a flowchart for our lighthouse which shows us how we can use a subroutine to make the lighthouse lamp flash by reusing the same flowchart.

lighthouse flow chart

Using the flowchart above create a subroutine called 'flashes' which makes the lighthouse lamp flash, see what the addition of the number below to our subroutine does to our mimic.

subroutine symbol
  • Add a screenshot of your completed flowchart into your PowerPoint?


  • Task 4 - Pelican Crossing Click to see more

    Think about the things that happen at a pedestrian crossing when someone crosses the road. The green lights and red man stay on until the cross button is pressed – but what else happens? What are the steps that happen after the cross button is pressed?

    Watch the video and create an algorithm by clicking on the pelican crossing image below to download the file and then fill in the blanks.


    Task 5 - Creating subroutines Click to see more


    pelican crossing mimic
    • Create a subroutine to control only the flashing lights
    • Use the Sub option with a Start / Stop symbol
    • Refer to the Zebra Crossing mimic solution
    • Call the subroutine from the main program
    pelican crossing mimic

    Task 6 - Reviewing it all 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 completed the assessment for Term 2

    • I have a basic understanding of how I have completed the assessment for Term 2 with a little help from my teacher
    • I can show my teacher that I have completed the assessment for Term 2 without their help.
    • I have completed the assessment for Term 2 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


    My Notes: control

    Student_Comment_2 not found

    Task Notes/Comments - Add here Click to see more

    Comments/Notes

    Copyright © 2013 - 2024 LearnITwithMrC