Computer Studies

Algorithms and Flowcharts

Good programmers plan before they code. An algorithm organises a solution into steps, while a flowchart shows the steps visually.

JSS 2–SS 130 minInteractive quizOffline-ready
Algorithms and Flowcharts lesson illustration
Computer Studies • JSS 2–SS 130 min • self-paced
Learning objectives

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

  • Define an algorithm and state its qualities.
  • Write simple pseudocode using sequence and decisions.
  • Identify common flowchart symbols.
  • Trace a simple algorithm.
  • Apply computational thinking to everyday problems.
Core idea

What is an algorithm?

An algorithm is a finite, ordered set of clear steps for solving a problem or completing a task.
Everyday algorithm

Making a cup of tea

  1. Boil water.
  2. Place tea in a cup.
  3. Pour in hot water.
  4. Wait, then add other ingredients as required.
  5. Serve.
Quality checklist

A good algorithm should be…

🔢
Ordered

Steps follow a logical sequence.

🎯
Unambiguous

Each instruction has one clear meaning.

🏁
Finite

It eventually stops after completing the task.

⌨️
Has inputs

It may receive data needed for the solution.

📤
Has outputs

It produces a useful result.

Efficient

It avoids unnecessary work where possible.

Visual logic

Common flowchart symbols

StartTerminatorStart or end
ProcessRectangleInstruction or calculation
Yes?DiamondDecision or condition
InputParallelogramInput or output
Worked example

Decide whether a learner passed

BEGIN
  READ score
  IF score >= 50 THEN
    PRINT "PASS"
  ELSE
    PRINT "TRY AGAIN"
  ENDIF
END

The algorithm receives a score, tests a condition and follows one of two branches. This is called selection or a decision.

Trace it: when score = 65, the condition is true and the output is PASS. When score = 42, the output is TRY AGAIN.
Mother-tongue reinforcement

Review the main idea

English summary

An algorithm is a clear, ordered and finite set of steps. Pseudocode expresses the logic in simple words, while a flowchart uses shapes and arrows. A diamond represents a decision.

Question 1 of 5

Assignment

Apply your understanding

  1. Write an algorithm for brushing your teeth.
  2. Draw a flowchart that accepts a number and prints whether it is positive or negative.
  3. Trace the pass/fail pseudocode using scores of 20, 50 and 88.