Chapter 3

Pseudocode and Flowcharts

Pseudocode describes an algorithm in plain words; a flowchart draws it with standard shapes: oval, parallelogram, rectangle and diamond.

Pseudocode

Pseudocode describes the steps of an algorithm using simple, structured words instead of a real programming language. It is easy to read and helps you plan a program before writing real code. Common keywords include INPUT, OUTPUT, IF, THEN and REPEAT. Because pseudocode is not tied to any one language, the same plan can later be turned into Python, Scratch or any other language.

Example

INPUT age
IF age >= 18 THEN
OUTPUT "Adult"
ELSE OUTPUT "Not adult"

Flowchart symbols

A flowchart is a diagram that shows the steps of an algorithm using standard shapes joined by arrows. The arrows show the order, or flow, from one step to the next. Reading a flowchart from top to bottom, you follow the arrows through each shape until you reach the stop oval.

OvalStart or stop
ParallelogramInput or output
RectangleProcess or calculation
DiamondDecision (Yes / No)

Key idea

Oval = start/stop, parallelogram = input/output, rectangle = process, diamond = decision. A decision has two exits, usually Yes and No.

Why plan first?

Both pseudocode and flowcharts are planning tools. They let you check that your logic is correct before coding, so mistakes are easier to find and fix. The same algorithm can be written as pseudocode or drawn as a flowchart. A clear plan also makes it easier for a teammate to understand your idea and continue the work.

Remember

  • Pseudocode = steps in plain, structured words.
  • Flowchart = steps drawn with standard shapes and arrows.
  • Learn the four main shapes and what each one means.

Stuck on this topic? A verified JomKelas tutor can walk you through it.

Find a verified tutor