Computer Studies • JSS 2–SS 130 min • self-paced
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.
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.
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
- Boil water.
- Place tea in a cup.
- Pour in hot water.
- Wait, then add other ingredients as required.
- Serve.
A good algorithm should be…
🔢
OrderedSteps follow a logical sequence.
🎯
UnambiguousEach instruction has one clear meaning.
🏁
FiniteIt eventually stops after completing the task.
⌨️
Has inputsIt may receive data needed for the solution.
📤
Has outputsIt produces a useful result.
⚡
EfficientIt avoids unnecessary work where possible.
Common flowchart symbols
StartTerminatorStart or end
ProcessRectangleInstruction or calculation
Yes?DiamondDecision or condition
InputParallelogramInput or output
Decide whether a learner passed
BEGIN
READ score
IF score >= 50 THEN
PRINT "PASS"
ELSE
PRINT "TRY AGAIN"
ENDIF
ENDThe 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.
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
Apply your understanding
- Write an algorithm for brushing your teeth.
- Draw a flowchart that accepts a number and prints whether it is positive or negative.
- Trace the pass/fail pseudocode using scores of 20, 50 and 88.