Lesson Note: Algorithms and Flowcharts (SS2 Computer Studies)
Class: SS2
Subject: Computer Studies
Topic: Algorithms and Flowcharts
Duration: 40 Minutes
Lesson Objectives:
By the end of the lesson, students should be able to:
1. Define an algorithm.
2. Explain what a flowchart is.
3. List the symbols used in a flowchart and their meanings.
4. Describe the importance of algorithms and flowcharts in problem-solving.
5. Draw simple flowcharts to solve basic problems.
1. Introduction to Algorithm
What is an Algorithm?
An algorithm is a step-by-step procedure or a set of rules or instructions given to a computer (or a
person) to solve a problem or perform a task.
Example:
Algorithm to make tea:
1. Boil water
2. Put tea bag in a cup
3. Pour hot water into the cup
4. Add sugar/milk if needed
5. Stir the tea
6. Serve the tea
In computing, algorithms are written to help the computer solve problems.
2. Characteristics of a Good Algorithm
A good algorithm should:
- Have a clear starting point and ending point
- Be unambiguous (easy to understand)
- Be effective and efficient
- Give the correct result
- Be finite (must end after a certain number of steps)
3. What is a Flowchart?
A flowchart is a diagram that shows the step-by-step flow of an algorithm using symbols. It helps
programmers and students visualize the steps involved in solving a problem.
4. Flowchart Symbols and Their Uses
| Symbol | Name | Description |
|--------|----------------|---------------------------------------------------|
| Ovals | Terminator | Start or End of a flowchart |
| Rectangle | Process | A step or instruction |
| Diamond | Decision | A condition with Yes or No outcomes |
| Parallelogram | Input/Output | Data entry or display result |
| Arrow | Flowline | Shows direction of flow |
5. Importance of Algorithms and Flowcharts
- They help solve problems logically.
- They make programming easier by planning the steps before coding.
- They help in debugging (finding and fixing errors).
- They make teamwork easier.
- They save time during program development.
6. Simple Algorithm and Flowchart Examples
Example 1: Algorithm to Add Two Numbers
Algorithm:
1. Start
2. Input first number (A)
3. Input second number (B)
4. Add A and B and store in C
5. Display C
6. End
Example 2: Algorithm to Check if a Number is Even or Odd
Algorithm:
1. Start
2. Input number (N)
3. If N mod 2 = 0, then
Display "Even"
Else
Display "Odd"
4. End
7. Assignment / Class Work
Draw a flowchart to:
1. Find the largest of two numbers.
2. Calculate the area of a rectangle (Length × Breadth).
3. Accept a student's score and determine if they passed (score >= 50) or failed.
Conclusion:
- Algorithms and flowcharts are basic tools for computer programming.
- Algorithms are step-by-step instructions.
- Flowcharts are diagrams that show those steps.
- They help plan, understand, and communicate how a program works.