Year 10 - Computing
Functions
Programming: subroutines
Study Hub
This pupil-friendly study guide includes a unit summary, clear notes, common mistakes, and quick questions with answers.
Year 10 - Computing
Programming: subroutines
In this unit pupils will be introduced to structured programming. They will explore the differences between functions and procedures and use functions to return values in programs. They will be introduced to the concept of scope and how parameters can be used to reduce the need for global variables.
You will learn to create a program that uses a function to return values.
A function is a named block of code that is called to perform a task and will return a value. A return value is a value that is returned to the calling program.
a subroutine that returns a value. Add one real device or system example to prove understanding.
Mistake: When a function returns a value it can be used throughout the program that called it. Correction: The return value needs to be stored if it is to be used later in the program that calls it. If it isn't stored, the value cannot be used again.
Browse all guides in the Year 10 Computing guide library.