2.2.2

Program Flow 1

Test yourself

Sequence

Sequence is the simplest structure for an algorithm to follow.

Illustrative background for SequenceIllustrative background for Sequence ?? "content

Sequence

  • In a sequence algorithm, the computer follows a series of steps that are executed in the same order every time it runs.
  • This is often not very useful for longer codes because we cannot use any selection or iteration structures.
Illustrative background for Flow chartIllustrative background for Flow chart ?? "content

Flow chart

  • The flow chart for a sequence program will have the blocks one by one.
  • One arrow will connect each block to the next block.
  • There will be no diamond shapes, so the diagram will be mainly:
    • Ovals.
    • Rectangles.
    • Parallelograms.

Selection

Selection allows us to have decisions made in our program.

Illustrative background for SelectionIllustrative background for Selection ?? "content

Selection

  • Selection allows us to execute a section of code depending on whether a condition is met or not.
Illustrative background for If-statementsIllustrative background for If-statements ?? "content

If-statements

  • An if-statement is an easy way of checking if a condition is true.
Illustrative background for Switch-case statementIllustrative background for Switch-case statement ?? "content

Switch-case statement

  • A switch-case statement checks the value of a single variable.
Illustrative background for Flow diagramIllustrative background for Flow diagram ?? "content

Flow diagram

  • The diamond symbol is used to show selection in a flow diagram.

Jump to other topics

1Computer Systems

1.1Systems Architecture

1.2Memory & Storage

1.3Computer Networks, Connections & Protocols

1.4Network Security

1.5Systems Software

1.6Ethical, Legal, Cultural & Environmental Concern

2Computational Thinking, Algorithms and Programming

Go student ad image

Unlock your full potential with GoStudent tutoring

  • Affordable 1:1 tutoring from the comfort of your home

  • Tutors are matched to your specific learning needs

  • 30+ school subjects covered

Book a free trial lesson