The function of structural components of programs - EdexcelThe three basic programming constructs

Programs are designed and implemented using common building blocks, known as programming constructs. These constructs are sequence, selection and iteration and they form the basis for all programs.

Part of Computer ScienceApplication of computational thinking

The three basic programming constructs

are designed using common building blocks. These building blocks, known as programming constructs, form the basis for all programs.

There are three basic building blocks to consider:

Sequence is the order in which occur and are processed. Selection determines which path a program takes when it is running. Iteration is the repeated of a section of code when a program is running.

There are two types of iteration:

  • count-controlled iteration
  • condition-controlled iteration

All programs use one or more of these constructs. The longer and more complex the program, the more these constructs will be used repeatedly.

This guide uses examples to illustrate the constructs. It is important to realise that while all include these constructs, there may be slightly different formats.