11.3 Structured Programming

2026 Syllabus Objectives

By the end of this topic, you should be able to:

  • define and use a procedure
  • explain where in an algorithm it is suitable to use a procedure
  • use parameters
  • understand that a procedure may have no parameters, one parameter, or many parameters
  • understand that a parameter can be passed by value or by reference
  • define and use a function
  • explain where in an algorithm it is suitable to use a function
  • understand that a function is used inside an expression, where the returned value replaces the function call
  • use the correct terminology: procedure header, function header, procedure/function interface, parameter, argument, return value
  • write efficient pseudocode

What is structured programming?

Structured programming means writing programs in a clear, organised way. Instead of putting every instruction in one long block, the program is broken into smaller parts. Each part has a clear job.

This makes a program:

  • easier to read
  • easier to test
  • easier to fix
  • easier to change later
  • less repetitive

One of the main ways to structure a program is to use procedures and functions. These are both types of subprograms, which means smaller sections of code inside a larger program.


Procedures and functions: the big idea

A large problem is often easier to solve if it is split into smaller tasks. For example, a program may need to:

  • input data
  • check that the data is valid
  • calculate a result
  • display the result

Instead of writing all of this in one place, each task can be placed in its own procedure or function.

This gives the program a better structure. It also means the same code can be reused instead of being written again and again.


What is a procedure?

A procedure is a subprogram that carries out a task, but does not return a value.

You use a procedure when you want something to be done.

For example, a procedure may:

  • display a message
  • print a report
  • swap values
  • process an array
  • validate input
  • update data

A procedure is usually called as a separate statement.

Sign in to view full notes