Flowchart Examples
Flowchart Examples
End
6. Flowchart
Aim: In this lesson, you will learn:
How to draw a flowchart for problem solving.
Structures of a flowchart.
Count = 1
Print N x Count
No
Is
Count = 10
Yes
Stop
Tejas: We visited a computer exhibition for school students. We saw a super computer, demonstration
of many uses of computer and many interesting applications.
Jyoti: In one of the stalls, we could enter any number as input and the computer was displaying the
multiplication table of the number. The picture shown above was used by the person at the stall,
to explain the sequence of steps followed by the computer, to display the table.
Jyoti: We observed that those who did not know about computers and programming could also
understand what was explained by the picture.
Moz: This picture is called a flowchart. One of the uses of flowchart is to describe the sequence
of steps and logic of solving a problem, before writing a computer program. Flowchart also helps
in communicating the steps of the solution to others.
Tejas: I see that various geometrical shapes are used in this representation. We are eager to learn
about flowcharts.
Moz: Let us start with a simple example. Look at the following flowchart of adding two natural
numbers A and B. Let us discuss the problem solution and the geometrical shapes used.
86
Flowchart - How to find sum of two numbers
Read A A= 845
Read B B= 247
End End
Jyoti: Start and also end of the flowchart are shown with an ellipse.
Moz: A flowchart should give a clear indication as to where the problem solving flow starts and
where it ends. The start of a problem solving process and the end are indicated using the ellipse.
Tejas: Our goal is addition of two given numbers. So, first we identify the data that is given.
In this problem we have the two numbers A and B. Reading the values are represented by
parallelograms.
Moz: Right. What would you call reading in values in computer terms?
Jyoti: Input.
Moz: The data or information that is available, (which is called input) is represented using a parallelogram
in the flowchart.
Moz: What is the next step?
Tejas: The next step is to add the numbers, which is called processing in computer terms. The
details of processing of data is represented in a rectangle.
Moz: Correct.
Jyoti: The next step is to write the result of the addition, which is output in computer terms. This
is also specified in a parallelogram.
Moz: Right. A parallelogram is used to specify both input and output in a flowchart. What else do
you notice in the flowchart?
Tejas: An arrow points from one step to the next step in the flowchart.
Moz: In a flowchart arrows are used to connect the steps in a sequence and show the flow of the
problem solving process.
Jyoti: We learnt step by step thinking to solve a problem in Computer Masti- Level III. Using flowcharts
we can show the sequence of these steps.
Moz: Yes. The step by step method of solving the problem is specified using a flowchart. This
helps you to be clear about the input, procedure and output. It also helps you to communicate the
solution.
87
Flowchart
What is a flowchart?
A flowchart is a picture (graphical representation) of the problem
solving process.
A flowchart gives a step-by-step procedure for solution of a
problem.
Concept
Elements of a flowchart:
Various geometrical shaped boxes represent the steps of the
solution.
The boxes are connected by directional arrows to show the
flow of the solution.
Uses of a flowchart:
To specify the method of solving a problem.
To plan the sequence of a computer program.
Communicate ideas, solutions.
Drawing a flowchart
Guidelines
Moz: Now consider the following problem and draw the flowchart for its solution.
Savani bought a toy for Rs. 325 and sold the same for Rs. 458. Explain how we can find if
Savani has made a profit or a loss.
Tejas: In this problem the goal is to find whether Savani makes a profit or loss.
Jyoti: We know the Cost Price and the Selling Price. We can read them as input, so they are
represented as parallelograms.
Read Cost price (CP)
Moz: You can also put both cost price and selling price in a single parallelogram.
Read Cost price (CP)
Read Selling price (SP)
Tejas: Next we have to compare Selling Price and Cost Price to find which price is more. This will
tell us whether Savani has made profit or loss. How do we show comparison in a flowchart?
Moz: Can you phrase this step as a question with the two possible answers?
Tejas: We can ask a question Is selling price more than cost price?
Moz: Right. The answer to this question can be Yes or No. If, answer is Yes we have to
calculate profit. If, answer is no we have to calculate loss. This decision taking step is represented
as a diamond in a flowchart.
Yes Next Step to be taken
Question?
when the answer is Yes.
No
Next Step to be taken
when the answer is No.
88
Jyoti: If the answer is Yes, it means that selling price is more than the cost price and Savani has
made profit. Profit is calculated as Selling price Cost price.
Is Yes
SP > CP ? Profit = SP - CP
No
Tejas: If the answer is No, it means that cost price is less than selling price and Savani has made
loss. Loss is calculated as Cost price Selling price.
Is Yes
SP > CP ? Profit = SP - CP
No
Loss = CP - SP
Moz: Good. You have used logical reasoning to solve this problem. Now complete the flowchart.
Start Start
This is a
decision
Read Cost price (CP) structure. Read CP=325
Read Selling price (SP)
Read SP= 458
Is Yes
Profit = SP - CP
Condition: Yes
SP > CP ? Profit= 458-325
Is 458 > 325?
No
Profit= Rs. 133
Loss = CP - SP
End
Print Loss Print Profit
End
89
Flowchart symbols and their purpose
Moz: Suppose you have to write a Scratch program using the flowchart that you have just drawn.
Can you do it now?
Tejas: Yes. We can!
Jyoti: This is great. We can also plan a computer program using flowcharts.
Jyoti: Sometimes we need to repeat a sequence. How do we represent this in the flowchart?
Moz: Let us consider the multiplication table flowchart that you saw at the exhibition. See how
repetition is represented in a flowchart. This is also called a loop.
Flowchart of multiplication table for a given number N
Multiplication table of 12
Start
Arrow connects Start
to the start of
the sequence to Read number N
N = 12
be repeated
This is a loop.
Count = 1 Count =1
Start of the
Multiple = N x Count sequence to 12 * 1 = 12
be repeated. Count = 1+1 = 2
Print count
12 * 2 = 24
times N = Multiple Count = 2+1 = 3
......
Count = 9+1 = 10
No Is 12 * 10 = 120
Add 1 to
the current Count = 10
value of count Count =10
Yes
End
End
90
Jyoti: The repetition sequence starts with Count=1. N is multiplied with 1 and output is printed.
Next since count is not equal to 10 we add 1 to count. N is multiplied with 2 and output is printed.
The sequence is repeated next for 3, 4 and so on.
Tejas: The repetition sequence stops when Count=10.
Moz: Correct. A decision structure has been used to start and stop the repetition.
Jyoti: In this flowchart output is not coming at the end and there are multiple outputs.
Moz: Good observation. The output need not always come at the end of a flowchart. Similarly in
some flowcharts input need not always be at the beginning of the flowchart.
Moz: Try out another problem how do you find the factorial of a number?
Jyoti: Suppose the number is 10. Then factorial of ten is calculated as
10! = 1*2*3*4*5*6*7*8*9*10
Moz: Can you draw the flowchart for finding factorial of any given number?
Jyoti: Yes. We can. We have to use both decision and loop in this flowchart.
Read N N = 10
Set M= 1 M=1
Set F= 1 F=1
............
M<10; M = 9 + 1 = 10
No Is
M = N?
F = 362880 * 10 = 3628800; M = 10
Yes
End End
Moz: Explain the logic that is used in the loop and specifically the following processing box of
the flowchart.
New value of F = current value
of F multiplied by M
91
Jyoti: N is the number for which we have to find the factorial.
At the start of the loop
We start with F =1 and M =1.
Since we have to start with 1 multiplied by 2 we add 1 to M.
Current value of F which is equal to 1 is multiplied by 2.
The result of this multiplication is equal to 2.
Since M is less than N we enter the loop again with current value of F=2.
Next we add 1 to M which becomes 3.
Current value of F which is equal to 2 is multiplied by 3.
The result of this multiplication is equal to 6.
Since M is less than N we enter the loop again with current value of F = 6.
Moz: Good. Now let us consider a game. Do you know the game of snakes and ladders?
Tejas: Yes.
Moz: Ok. Draw a flowchart to show how the game is played.
Tejas and Jyoti draw this flowchart.
Flowchart - Snakes and Ladder game
Start Snakes and ladders game with two
Give dice to players
next player
No
Reached
the last block No
of the game?
Yes
End
92
Uses of flowchart:
Graphical representation of instructions- for example games, building models etc.
Tejas: The flowchart itself can be put into the box of the game so that those who want to play
know the rules of the game and can easily understand how they win.
Moz: We have seen some examples where flowcharts are used. There are many more uses of
flowcharts and they can be used whenever you feel that you can communicate better with this
graphical representation.
Communicating ideas.
Show the logic of classification of data.
To teach and also to learn.
Yes
93
Level VI Lesson 6 WORKSHEETS
1. Which is not true about the arrows used in a flowchart?
i. Direction of arrow shows the flow in a flowchart.
ii. Arrows are used show the sequence of the problem solving.
iii. Arrows are used to connect boxes in a flowchart.
iv. Arrows can be used to represent an input.
2. Match the elements of a flowchart and their purpose of use in the following:
Purpose Use
Calculate total of A, B, C Loop
Indicate that the problem has been solved. Start
Find if a number is greater than the other Process
Read a number and calculate the factorial of the number. Input
Read three numbers Stop
Print the total Decision
Indicate beginning of a problem solving flow. Output
2
3
Across
1. I am a rectangle in a flowchart. What do I represent?.
2. When you want to show a decision making step, you can use this box.
4. You can use me to communicate ideas, graphically represent a problem solving process.
5. I connect two geometrical boxes in a flowchart.
Down
1. In the flowchart, I represent data or information that is available.
3. All flowcharts begin with me. I am elliptical in shape.
94
Level VI Lesson 6 WORKSHEETS
4. The following flowchart classifies animals as herbivore or carnivore. Lion is a meat eating
animal. Elephants eat only plants. Study the flowchart and answer the questions.
Start
Does it eat No
only plants?
Yes
End
a. Indicate each element of the flowchart by putting I for input, O for output, D for decision in
the circles provided next to the boxes.
b. Put a rectangle around the decision structure.
Hint: See page number 89 in the lesson.
c. What is the condition which classifies an animal as carnivore?
95
Level VI Lesson 6 WORKSHEETS
5. A, B, C are the marks scored by a student in Science, Mathematics and English. Refer the
flowchart and answer the questions.
a. Start
a. Sweta, who scores 60 marks in Science, 70 marks
in mathematics and 75 marks in English. Use the
adjacent flowchart and provide the execution steps
Read A, B, C in calculating the average marks of Sweta. The first
step is given.
60, 70, 75
Sum A + B + C
Average = Sum/3
Print Average
d. Marks of two more students are given below. Study it and fill in the blanks with the average marks of
each student and whether the student is awarded a star or not.
Science Mathematics English
Riya 75 80 72
Suman 72 70 82
96
Level VI Lesson 6 WORKSHEETS
e. The three main steps in the given flowchart are:
i. Read marks of three students.
ii.
iii.
6. The following empty flowchart gives the steps to be followed while seeking admission to
new school. The phrases to be filled in the boxes are also given. Complete the flowchart by
filling in the number of the correponding phrase, inside each box. For example: the number
corresponding to the first box in the flowchart is 7.
7
Yes
No
Yes
97
Level VI Lesson 6 WORKSHEETS
7. The following flowchart gives the steps followed while taking attendance in a class. Three
arrows and a loop are missing. Complete the flowchart as follows:
Draw the three missing arrows and loop at the correct place.
Label the decision arrows with yes or no.
Start
Mark present in
the register
Is it the
last name?
End
8. Frame a question. Hint: Try to make a question, which will have the answer given below.
For example: The answer given is:
Some of the boxes of different shapes used in a flowchart are
b. The answer given is : In a repetition structure, the process is repeated till the condition is satisfied.
The question can be:
c. The answer given is : The decision structure has two branches, Yes or No.
The question can be:
98
Level VI Lesson 6 WORKSHEETS
9. There are four types of fruits Apples, Oranges, Bananas and Grapes. Each student can pick
up two fruits. There are some conditions which have to be used to pick up the fruits. Draw a
flow chart which can take the name of first fruit as an input and print the names of second
fruit or fruits that can be picked up. The conditions are:
If you pick an apple you can pick banana.
If you pick orange you can pick grapes.
If you pick grapes you can pick banana.
99
Level VI Lesson 6 WORKSHEETS
10. Lengths of three sides of a triangle a, b, c are given as input. The following flowchart finds
if the triangle is isosceles, equilateral, or scalene. Some boxes in the flowchart are filled in for
you, fill in the rest of the details.
Hint: In an equilateral triangle three sides are equal.
In an isosceles triangle two sides are equal.
In a scalene triangle three sides are not equal.
Start
Yes
Is A = B ?
No
Is B = C ?
No
Print
Scalene Triangle
End
a. Use the above flowchart and provide the execution steps in finding whether
the given triangle with sides 5 cms, 5 cms and 3 cms is scalene or isosceles
or equilateral triangle.
s
5 cm
5 cm
3 cms
100
ACTIVITY Level VI Lesson 6
1. Select one of the games given below from GCompris and draw a flowchart to explain the rules of the
game.
Memory games with images
Image name (drag and drop each item above its name)
Numbers with dice
2. Use one of the following applications- open office draw or Kivio (available for Linux) or Diagram Ring
(available for Windows)- to draw a flow chart for the above using the computer.
Group Activity
3. Play Computer Class:
Divide the class into four teams- INPUT DATA, OPERATIONS, DECISION,
and OUTPUT. Nominate one person from input and output team to play the role
of start and end box respectively. Each group has a set task to perform based on
instructions given to them by another team.
For example: Let the situation be to purchase a birthday for your friend.
Start
Yes
End
101
ACTIVITY Level VI Lesson 6
You can give one the following situations for students to work through the process of flow chart.
i. A wired telephone in your house rings and you have to attend the call.
ii. You visit a pediatrician for check up.
iii. You go to a post office with a note of Rupees 10 to purchase stamps worth Rupees 5.
Project
4. a. Input, output and decision phrases are given in the table given below. Note that one input phrase corresponds
to one flowchart. Draw three flow charts using the phrases in the table for the following:
i. A flowchart which conveys the rules in AWARE.
ii. A flowchart which conveys Accept rule of SMART.
iii. A flowchart which conveys Meet rule of SMART.
b. There are three more rules of SMART which are Safety, Reliability, and Tell. Draw a flowchart for each of these
rules by creating the phrases on your own. Compare your flowcharts with other groups in the class.
c. The teacher can evaluate and select the flowcharts that can be converted to posters for SMART and AWARE
and put them up for display.
102
Teachers LevelVVI
Book
Corner Lesson6
Lesson 6
The objective of this lesson is to teach students how to draw flowcharts for understanding the
process of doing a variety of activities such as solving mathematical questions, puzzles.
Begin the class by drawing a flowchart (refer page 87) on the board. Use the technique of
guided inquiry by asking students appropriate questions but allowing them to discover the
answer on their own. Draw students attention to the starting point of the flowchart. Ask
students to read the flow chart as you point to the different boxes. Ask students to identify
what the different shapes of the boxes convey. Summarize the points mentioned by the
students and teach them the functions associated with each symbol and shape.
Repeat the above exercise with flowcharts on pages 89, 90, 91 and 92. Explain the concept of
sequence, decision structure and loop. Note that the flowchart on page 92 is chosen from a
non-mathematical context in order to ensure that students note that flowchart can be useful
in variety of contexts. Do worksheet 1 and 2 in class and give 3 as homework. Do activity 1
to provide students an opportunity to draw flowchart to explain rules of game. You can ask
students to do activity 2 in order to learn the skill of making flowcharts using a computer
application.
Ask students to solve the remaining worksheet questions to practice reading of flowchart
(worksheet 4, 5), filling the details of an incomplete flowchart (worksheet 6, 7, 10) and making
a flowchart on their own (worksheet 9). Students would require assistance to comprehend
the task of worksheet 8 as they are not familiar with this question format. Spend enough
time explaining them the task and encourage them to work it out on their own.
Summarise the lesson and end the class with activity 3 to further reinforce understanding
of flowchart.
Further Reading:
http://www.nos.org/htm/basic2.htm
http://asq.org/learn-about-quality/process-analysis-tools/overview/flowchart.html
http://users.evtek.fi/~jaanah/IntroC/DBeech/3gl_flow.htm
103