1.4 FLOWCHARTS - DEFINITION, NOTATIONS, EXAMPLES, ADVANTAGES AND LIMITATIONS, COMPARISON WITH ALGORITHMS.
1.4.1 Flowchart definition
· Flowchart is a diagrammatic representation of an algorithm. It helps us to understand the logical flow of the program.
· Flowchart shows flow of the whole process which includes the data inputs,process,decisions and output generated.
1.4.2 Flowchart notations
· It uses several geometric figures to represent operations and arrows to show the direction of the flow.
· Following notations or symbols are used to draw a flowchart shown in Figure 1.1
Figure 1.1
1.4.3 Flowchart Examples
Example 1 Draw a flowchart to add two numbers
Example 2 Draw the flowchart to find number is odd or even
Example 3Draw a Flowchart to find sum of digits of a number
1.4.4 Flowchart Advantages and Limitations
Advantages of flowchart:
1 Flowcharts are easily understood because it us in pictorial form.
2 Flowcharts can be used for purpose of documentation.
3 Flowcharts can be easily converted into program.
4 Flowcharts helps in analyzing the problem.
5 Flowcharts helps us in debugging the program.
Limitations
1 It is not executable.
2 When problem is lengthy and complicated then drawing flowchart becomes difficult.
3 If any error occurs then we need to redraw flowchart again.
4 Every instruction has to be written with the blocks then it becomes difficult for big
Program.
1.4.5 Comparison with Algorithms and Flowchart:
Algorithms
|
Flowchart
|
Algorithm is step by step solution to the problem i.e. well-defined sequence of steps
|
Flowchart is diagrammatic representation of a program i.e. flowchart explains the steps of a program in a graphical way
|
There is no syntax to write an Algorithm
|
Symbols are used in flowchart
|
Algorithm is translated into Flowchart
|
Flowchart is converted into program
|
For complex problem algorithm can be written by modular approach
|
It is difficult to draw flowchart for complex problem or lengthy problem
|
0 Comments:
Post a Comment