Programming · Both

Algorithms & Computational Thinking

Before writing code, break the problem down and plan the steps. Examiners reward clear algorithmic thinking.

Key ideas

• **Decomposition** – split a problem into smaller parts • **Abstraction** – focus on important details; ignore noise • **Algorithm** – a precise sequence of steps to solve a problem • Represent with **flowcharts** or **pseudocode**

Pseudocode habits

Use clear keywords: INPUT, OUTPUT, IF, ELSE, WHILE, FOR Keep steps in order; indent selections and loops. Test your logic with sample inputs before coding.

Worked example

Pseudocode: check if a mark is a pass (≥ 50)?

Solution: INPUT mark IF mark >= 50 THEN OUTPUT "Pass" ELSE OUTPUT "Fail" ENDIF

Practice questions

1. What is decomposition?

2. Name two ways to represent an algorithm.