Académique Documents
Professionnel Documents
Culture Documents
7. Computer Programming
7.3 Flow Charts
A flowchart is a diagram to represents an algorithm or process.
Shows the process steps as various boxes connected with arrows.
A diagram that represents step-by-step solution to a problem.
Arrows represent flow of control.
Help analyzing, designing, documenting of programs
Niranjan Meegammana
0777 606 796
www.shilpasayura.org
1
Niranjan Meegammana
0777 606 796
www.shilpasayura.org
2
Niranjan Meegammana
0777 606 796
www.shilpasayura.org
3
Niranjan Meegammana
0777 606 796
www.shilpasayura.org
4
Niranjan Meegammana
0777 606 796
www.shilpasayura.org
5
Variables :
Bunches_Sold
Highest_Price
Lowest_Price
Total_value
Average_Price
Decisions:
Find_Highest Value
Find_Lowest Value
Loops:
Selling Pumpkin
www.shilpasayura.org
6
Niranjan Meegammana
0777 606 796
www.shilpasayura.org
7
Exercise
Assume you have the following data stored in a file
CLASS12A,Nishan,Ishan,Rishan,Sohan,Dashan,Kushan,Deshan,Ush
an,Ashan,CLASS12B,Milan,Dilan,Zilan,Rushan,CLASS12C,END
It represents students in different classes.
Design a program using flow charts to:
reads the data and displays the names of the students
under each class
count the number of students in each class
count the number of classes
Niranjan Meegammana
0777 606 796
www.shilpasayura.org
8
Niranjan Meegammana
0777 606 796
www.shilpasayura.org
9
Niranjan Meegammana
0777 606 796
www.shilpasayura.org
10
Niranjan Meegammana
0777 606 796
www.shilpasayura.org
11
Nassi-Schneiderman diagram
The Nassi-Schneiderman (NS) diagram is a graphical method of
stating algorithms. It is very easy to read for beginners.
NS diagram indicates an algorithm with a
process (Process 1) followed by a decision.
Each outcome of the decision has a process
associated with it. If the decision
evaluates as true then Proc 2 is carried
out, if false then Proc 3 is carried out. I
Niranjan Meegammana
0777 606 796
www.shilpasayura.org
12
Niranjan Meegammana
0777 606 796
www.shilpasayura.org
13
Niranjan Meegammana
0777 606 796
www.shilpasayura.org
14