Professional Documents
Culture Documents
Process / Input /
Start / End
Task Output
The start or end Process or Data: Inputs
of a workflow action to, and
outputs from,
a process
Decision Connector
Algorithm:
Ask employee for the number of hours
he/she works
Ask employee for his/her pay rate (salary
per hour)
Multiply hours with pay rate
Store result in Total Pay
Display Total Pay on screen
5
Calculate Pay
START
Display message
Flowchart
“How many hours
did you work?”
Read Hours
The figure shown here is a
flowchart for the pay- Display message
calculating algorithm “How much do you
get paid per hour?”
Read PayRate
Multiply Hours by
PayRate. Store result
in Total Pay.
END
START Terminal 6
ending point
Read PayRate
Multiply Hours
by PayRate.
START Store result in
Total pay.
Display Total
pay
END Terminal
END
START
7
output operation
Read PayRate
Multiply Hours
by PayRate.
Display message Store result in
Total pay.
“How many
Read Hours
hours did you Display Total
pay
work?”
END
START
8
as a mathematical
computation or an action Read PayRate
Multiply Hours
by PayRate.
Process Store result in
Multiply Hours Total pay.
by PayRate.
Store result in Display Total
pay
Total pay.
END
Basic Flowchart Symbols 9
Connectors:
The “A” connector indicates that the second
flowchart segment begins where the first
segment ends START A
END
A
Four Flowchart Structures 10
Sequence
Decision
Repetition
Case
Sequence Structure 11
Flowchart
C++ Code
NO YES
x < y?
if (x < y)
a = x * 2;
Calculate a Calculate a
else
as x plus y as x times 2
a = x + y;
Decision Structure 13
Flowchart
C++ Code
NO YES if (x < y)
x < y?
a = x * 2;
Calculate a as x
times 2
Repetition Structure 14
while (x < y)
YES x++;
x < y? Add 1 to x
Controlling a Repetition 15
Structure
The action performed by a repetition
structure must eventually cause the loop
to terminate. Otherwise, an infinite loop is
created
In this flowchart segment, x is never
changed. Once the loop starts, it will
never end
QUESTION: How can this
flowchart be modified so YES
it is no longer an infinite x < y? Display x
loop?
Controlling a Repetition 16
Structure
ANSWER: By adding an action within the
repetition that changes the value of x
YES
x < y? Display x Add 1 to x
Case Structure 17
If years_employed = 2, If years_employed = 3,
bonus is set to 200 bonus is set to 400
If years_employed = 1, If years_employed is
CASE
bonus is set to 100 years_employed any other value, bonus
is set to 800
1 2 3 Other
Display “x is NO YES
outside the limits.”
x < max?
Display “x is Display “x is
outside the limits.” within limits.”
Review 19
Decision
Terminal
Input/Output
Operation Connector
Process
Review 21
Sequence
Decision
Repetition
Case
Review 23
Repetition
Review 25
Sequence
Review 27
Case
Review 29
Decision
31
Algorithm:
Input the length in feet (LFT)
Calculate the length in cm (LCM) by
multiplying LFT with 30
Print length in cm (LCM)
Length Example 33
Flow chart
Start
Input
LFT
LCM LFT x 30
Print
LCM
Stop
Calculate Interest 34
Algorithm:
Step 1: Read amount
Step 2: Read years
Step 3: Read rate
Step 4: Calculate the interest with formula
"Interest=Amount*Years*Rate/100
Step 5: Print interest
Calculate Interest 35
Flow Chart
Even or Odd Number 36
Algorithm:
Step 1: Take a number N as input from
user
Step 2: Set remainder as N modulo 2
Step 3: If remainder is equal to 0 then
number N is even, else number N is odd
Step 4: Print output
Even or Odd Number 37
Flow Chart
Selection Sort 38
Algorithm
Step 1: Find the smallest number. Swap it with the
first number
Is Loc less
Flow chart than length
of list-1? false
true
Add 1 in Loc
STOP
40
https://www.edrawsoft.com/algorithm-
flowchart-examples.php