Skip to Content

Session 3,4 Algorithm and flowchart

πŸ“˜ Chapter Introduction

This session introduces two of the most essential tools in programming and problem-solving: Algorithms and Flowcharts. Before writing code, it's crucial to design a clear planβ€”and that’s where these tools come in. Algorithms provide step-by-step instructions to solve a problem, while flowcharts use visual symbols to make those instructions easy to follow.


🎯 Learning Objectives

By the end of this session, students will:

  • Define and explain the importance of algorithms and flowcharts.

  • Identify standard flowchart symbols and their purposes.

  • Learn how to structure logic for decision-making in a program.

  • Create an algorithm and flowchart for common real-world problems like Profit and Loss.


πŸ“š Content Covered

1. What is a Flowchart?

  • A visual diagram showing the step-by-step plan to solve a problem.

  • Uses symbols like boxes, diamonds, parallelograms, and arrows.

2. Flowchart Symbols

SymbolMeaning
TerminalStart/Stop of a process
Input/OutputData input or output
ProcessingComputation or action
DecisionYes/No or True/False decision point
ConnectorLinks parts of complex flowcharts
Flow LineDirection of flow

3. Example Flowchart – Profit & Loss

  • Inputs: Cost Price (C.P.) and Selling Price (S.P.)

  • Logic:

    • If SP > CP β†’ Profit = SP – CP

    • If CP > SP β†’ Loss = CP – SP

    • Else β†’ No Profit, No Loss

4. What is an Algorithm?

  • A sequence of logical steps to solve a problem.

  • Written in simple language.


πŸ’» Example: Algorithm for Profit or Loss

text
Step 1: Start
Step 2: Input Cost Price (CP)
Step 3: Input Selling Price (SP)
Step 4: If SP > CP
            Profit = SP - CP
            Print "Profit" and Profit
        Else if CP > SP
            Loss = CP - SP
            Print "Loss" and Loss
        Else
            Print "No Profit No Loss"
Step 5: End


🧰 Requirements

  • Basic understanding of input/output and comparison logic.

  • Awareness of conditional flow (if-else).

  • Tools: Paper/pencil or software for drawing flowcharts (like Lucidchart or draw.io).


🏁 Learning Outcomes

After completing this session, you’ll be able to:

  • Distinguish between a flowchart and an algorithm.

  • Recognize how visual representation improves logic clarity.

  • Design algorithms and flowcharts for problem-solving.

  • Apply this knowledge before diving into actual coding tasks.


 
0 0

There are no comments for now.

to be the first to leave a comment.