Professional Documents
Culture Documents
Algorithm and Flowchart
Algorithm and Flowchart
Flowchart
SHALINI BHASKAR BAJAJ
Solving Problems : Abstraction
Abstraction is the act of representing essential features without including the
background details or explanations.
Abstractions may be formed by reducing the information content of a concept or an
observable phenomenon.
E.g.: addressing a person by his/her NAME not by their individual body parts/features.
To solve any computational problem we need to represent the problem in an
abstract form. This abstract form is known as Algorithm.
Thus, the abstraction principle is used to reduce complexity and allow efficient
design and implementation of complex software systems
Playground
Gym
Playground Gym
Algorithm:
1. Go straight.
2. Take left turn.
3. you will reach AUH.
SHALINI BHASKAR BAJAJ 6
What Is An Algorithm?
1. Go straight
Hospital
Playground
Gym
SHALINI BHASKAR BAJAJ 8
What Is An Algorithm?
2. Take Left turn
AUH Market
Market
Hospital
Playground
Gym
SHALINI BHASKAR BAJAJ 9
What Is An Algorithm?
2. Take left turn WRONG
Market
AUH
Market
Hospital
Playground
Gym
SHALINI BHASKAR BAJAJ 10
What Is An Algorithm?
2.Take left turn WRONG
Market
Market
AUH
Hospital
Playground
Gym
SHALINI BHASKAR BAJAJ 11
What Is An Algorithm?
◦ A computer algorithm is a detailed set of instructions when executed sequentially solves a
problem
WRONG
Algorithm:
1. Go straight.
2. Take 1st left turn. (no ambiguity)
3. you will reach AUH.
Hospital
Playground
Gym
SHALINI BHASKAR BAJAJ 13
How to develop an Algorithm ?
Steps to be followed:
X Y Step 4 X Y Step 5
23 23 23 48 X Y
23 48
Temp Temp
48 48
Output
◦ Money, error messages
Inputs
◦ User Identification (ATM card), password, amount
Terminal Symbol
• start and stop
Decision
• Diamond indicate decision point in the program
flow. It may have 2 way branch or 3 way also.
Flow Lines
• A Straight line between two boxes shows the path of logic
flow in the program.
• An arrow head on the top of the line shows the direction of
the flow, data from top to bottom and left to right.
Connectors
• 2 small circles are used to connect separated portions of a
flowchart without drawing lines between the parts.
• One connector indicated where the flow breaks off and the
other indicates where it resumes.
No Return
Is Password Generate
Correct? ATM card
Error Message
Yes
Get amount
No
Is amount < Generate
Balance Error Message
Yes
Subtract amount
from balance Dispense cash
•It provides a clear overview of the entire program and problem and solution.
Stop
Stop
1. Start
Read three numbers
2. Read A, B, C A,B,C
3. If A > B is True, then check
whether A > C, if yes then A
is greatest otherwise C is Yes No Yes Yes
greatest Is B>C ? Is A>B ? Is A>C ?
Stop
Stop