Algorithms and Flowchart
Download the Lessonotes Mobile Nigeria 2025 app for faster lesson access on Android and iPhone.
Subject: Computer & IT
Class: Senior Secondary 2
Term: 3rd Term
Week: 2
Theme: Developing Problem-Solving Skills
This page supports the lesson note with a companion video and a short classroom-ready summary.
For class groups and homework, share this lesson page so learners also get the summary, objectives, and full lesson context.
Define Algorithmand flowchart. State the functionsof algorithm State and describethe characteristics of algorithm Write simplealgorithm for problem solving List flowchartsymbols State what eachsymbol stands for Draw flowchartsfor solving a givenproblem
Algorithms serve several critical functions in problem-solving and computer science: Clarity and Understanding: They break down complex problems into smaller, manageable, and easy-to-understand steps, making the problem-solving process clearer.
Planning and Design: Algorithms provide a structured approach to plan and design solutions before actual coding begins, helping to identify potential issues early.
Efficiency: They enable the development of optimized solutions, allowing comparison of different approaches to find the most efficient method (in terms of time and resources).
Communication: Algorithms act as a universal language for describing solutions, facilitating communication among programmers and stakeholders.
Debugging and Maintenance: A well-defined algorithm makes it easier to trace errors (debug) and modify (maintain) a program later.
Foundation for Programming: They are the backbone of any computer program, providing the logical blueprint for coding. A good algorithm possesses the following essential characteristics: Finiteness: An algorithm must terminate after a finite number of steps. It cannot run indefinitely. Every step must eventually lead to a conclusion.
Example:* If an algorithm is designed to sum numbers from 1 to 10, it must stop after adding
1
0. Definiteness (Unambiguity): Each step of an algorithm must be precisely defined and unambiguous. There should be no room for subjective interpretation. Each instruction should be clear and have only one meaning.
Example:* "Add 5 to the number" is definite. "Make the number bigger" is not definite.
Input: An algorithm must accept zero or more well-defined inputs. These are the quantities or data that are provided to the algorithm before it begins or during its execution.
Example:* For an algorithm that computes the average of three numbers, the three numbers (a, b, c) are the inputs.
Output: An algorithm must produce one or more well-defined outputs. These are the results or solutions obtained after the algorithm has processed the inputs.
Example:* For an algorithm that computes the average of three numbers, the calculated average is the output.
Effectiveness: Each instruction in an algorithm must be basic enough that it can, in principle, be carried out by a person using a pencil and paper in a finite amount of time. It must be feasible and achievable.
Example:* "Multiply X by Y" is effective. "Find the largest prime number" is not effective (as there's no largest prime). The following are standard symbols used in drawing flowcharts: | Symbol | Name | Purpose/Meaning | Example Use | | :-------------- | :----------- | :------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------ | |  | Terminal (Start/End) | Represents the beginning or end of a program or process. | `START`, `END` | |  | Input/Output | Represents any input operation (e.g., getting data from user) or output operation (e.g., displaying results). | `READ A`, `PRINT SUM` | |  | Process | Represents a process, calculation, or data manipulation (e.g., arithmetic operations, assignments). | `CALCULATE AVERAGE`, `SUM = A + B` | |  | Decision | Represents a point where a decision is made. It usually has two or more exit paths (e.g., Yes/No, True/False). | `IS A > B?` | |  | Flow Line | Shows the direction of flow from one symbol to another. Connects all other symbols. | Connects `START` to `READ A`. | |  | Connector | Used to connect different parts of a flowchart, typically when the flowchart spans multiple pages or sections. | Connects a flow to a different part of the flowchart. Usually contains a number or letter identifier. | Example 1: Algorithm to compute the average of three numbers (a, b, c) START GET three numbers (let's call them A, B, and C)
CALCULATE their sum: SUM = A + B + C CALCULATE the average: AVERAGE = SUM / 3 DISPLAY the AVERAGE END Example 2: Algorithm to calculate the area of a triangle with base 'b' and height 'h'. START GET the base (B) of the triangle. GET the height (H) of the triangle.
CALCULATE the area: AREA = 0.5 B H DISPLAY the AREA END
ATM Operations/Mobile Banking Apps: When a user requests to withdraw cash from an ATM or transfer funds using a mobile banking app (e.g., OPay, GTBank app), a predefined algorithm ensures that: The card/account details are verified. The balance is sufficient. The amount is dispensed/transferred. The account is debited. A receipt is printed/transaction confirmed. Any error conditions (e.g., insufficient funds) are handled. This systematic execution is a perfect example of algorithms in action, critical for financial transactions across Nigeria.
Traffic Light Systems in Nigerian Cities: Traffic lights (e.g., in major intersections in Lagos, Abuja, Port Harcourt) operate based on algorithms.
These algorithms determine: The sequence of light changes (Red, Amber, Green). The duration of each light, possibly adjusted based on time of day or traffic sensor data (e.g., longer green light on a major road during peak hours). How to handle pedestrian crossings. This demonstrates how algorithms manage complex real-time systems to maintain order and efficiency.
Local Market Stock Management / Inventory: A small business owner in a Nigerian market (e.g., selling textiles in Ariaria Market, Aba, or grains in Mile 12 Market, Lagos) can use algorithmic thinking to manage their stock.
An algorithm could: Track incoming goods. Record sales. Calculate remaining stock. Alert when stock levels fall below a reorder point. This application illustrates how algorithms can simplify complex record-keeping and decision-making for local entrepreneurs. ---