Skip to content

Study Hub

Study Guides

This pupil-friendly study guide includes a unit summary, clear notes, common mistakes, and quick questions with answers.

Year 10 - Computing

Functions

Programming: subroutines

Unit Summary

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.

Lesson Summary

You will learn to create a program that uses a function to return values.

Key Notes

  • 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.
  • Arguments are values provided to a subroutine at the time it is called.
  • Subroutine parameters are values used by the subroutine that are passed from the arguments when it is called.

Vocabulary To Learn

  • function: a subroutine that returns a value
  • return value: a value that is returned by a function
  • parameter: used in a subroutine to allow values to be passed into them
  • argument: values held in the brackets of a subroutine call, which are passed into a subroutine via the parameters

Common Mistakes To Avoid

  • When a function returns a value it can be used throughout the program that called it.

3 Quick Questions (With Answers)

1. Describe the system or process from this lesson in clear steps.

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.

2. Define this computing term and give one practical example. 'function'

a subroutine that returns a value. Add one real device or system example to prove understanding.

3. Correct this common computing misconception.

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.

More Lessons In This Unit

Browse all guides in the Year 10 Computing guide library.