COM113 Assignment: Methods of
Representing Algorithms
Introduction
An algorithm is a step-by-step way to solve a problem. There are different ways to show or
represent an algorithm so that others can understand it easily. The common methods
include:
1. Flowchart
A flowchart is a diagram that uses symbols (like arrows, ovals, rectangles, diamonds) to
show the steps in an algorithm.
- Oval = Start or End
- Rectangle = Process or instruction
- Diamond = Decision (Yes/No)
- Arrow = Shows the flow (direction) of steps
Example: Start → Input Numbers → Add Them → Show Result → End
2. Pseudocode
Pseudocode is a simple way of writing the algorithm using a mix of plain English and
programming-style logic.
It is not a real programming language. It uses clear and short instructions like:
Start
Input A, B
Sum = A + B
Print Sum
End
3. English Natural Language
This means writing the steps of the algorithm using normal everyday English.
It is the simplest form. Useful for explaining the logic to people who don't know
programming.
Example: "First, take two numbers from the user. Then, add the numbers. Finally, show the
result."
4. Data Flow Diagram (DFD)
A Data Flow Diagram shows how data moves through a system.
It shows input, process, and output. Symbols used:
- Circles for processes
- Arrows for data flow
- Rectangles for external entities (like users)
- Open rectangles for data stores (like files or databases)
5. Decision Table
A Decision Table is used to represent complex decision-making using a table.
Rows = Conditions and Actions
Columns = Different possible situations (rules)
Example:
| Condition 1 | Condition 2 | Action |
|-------------|-------------|--------|
| Yes | No | Do X |
| No | Yes | Do Y |