1.5 Flowchart
1.5 Flowchart
5 Flowchart:
A flowchart can be defined as a diagrammatic representation of an algorithm, a step-by-step
approach to solving a task.
Types of Flowcharts:
2. Data flowchart: It is used to analyze the data; specifically it helps in analyzing the
structural details related to the project. It is most commonly used to manage data or to analyze
information to and fro from the system.
3. Business Process Modeling Diagram: It analytically represents the process and concepts of
business activities and the flow of information. It illustrates the business process and models
graphically which paves the way for process improvement.
Terminal/Terminator
Process
Decision
Document
Data or Input/output
Stored Data
Symbol Name Symbol Representation
Flow Arrow
Comment or
Annotation
Predefined process
On-page
connector/reference
Off-page
connector/reference
1. Terminal
It is used to indicate the start or end of the program. Every flowchart diagram has an oval shape that
depicts the start of an algorithm and another oval shape that depicts the end of an algorithm.
For example:
2. Data
It is a parallelogram-shaped box inside which the inputs or outputs are written. It basically depicts
the information entering into the system or algorithm and the information leaving the system or algorithm.
For example:
If the user wants to input a from the user and display it, the flowchart would be:
3. Process
It is a rectangular box inside which a programmer writes the main course of action of the algorithm
or the main logic of the program. It is the crux of the flowchart as the main processing codes is written
inside this box.
For example:
If the programmer wants to add 1 to the input given by the user, he/she would make the following
flowchart:
4. Decision
It is a rhombus-shaped box, control statements like if, condition like a > 0, etc. are written inside this
box. There are 2 paths from this one which is “yes” and the other one is “no”. Every decision has either yes
or no as an option.
For example:
If the user wants to add 1 to an even number and subtract 1 if the number is odd, the flowchart would be:
5. Flow
It represents the flow of the algorithm or process. It represents the direction of the process flow. It display
the flow of the program arrow increases the readability of the program.
6. On-Page Reference
It is used to depict that the flowchart is in continuation with the further steps.
For example:
Advantages of Flowchart
Disadvantages of Flowchart
Flowcharts are challenging to draw for large and complex programs.
It does not contain the proper amount of details.
Flowcharts are very difficult to reproduce.
Flowcharts are very difficult to modify.
Examples:
1. Draw a flowchart to find the greatest number among the 2 numbers.
Solution:
Algorithm:
1. Start
2. Input 2 variables from user
3. Now check the condition If a > b, goto step 4, else goto step 5.
4. Print a is greater, goto step 6
5. Print b is greater
6. Stop
Flowchart:
2.
Draw
a
Solution:
Algorithm:
1. Start
2. Put input a
3. Now checks the condition if a % 2 == 0, goto step 5. Else goto step 4
4. Now print (“number is odd”) and goto step 6
5. Print (“number is even”)
6. Stop
Flowchart:
Solution:
Algorithm:
1. Start
2. Input number a
3. Now initialise c = 1
4. Now we check the condition if c <= 5, goto step 5 else, goto step 7.
5. Print a
6. c = c + 1 and goto step 4
7. Stop
Flowchart: