Flowchart Definition:

A flowchart is a pictorial representation of an algorithm that uses boxes of different shapes to denote different types of instructions. These instructions are followed in a logical sequence to produce the required output.
 
The actual instructions are written within these boxes using clear and concise statements. These boxes are connected by solid lines having arrow marks to indicate the flow of operations that is the exact sequence in which the instructions are to be executed.

History of Flowchart:

The first structured method for documenting process flow was introduced by Frank Gilbreth to the members of the American Society of Mechanical Engineers (ASME) in 1921 in the presentation “First Steps in Finding the One Best Way”.
 
Gilbreth’s tools quickly found their way into industrial engineering curricula. In the early 1930s, an industrial engineer, Allan Herbert Mogensen began training business people in the use of some of the tools of industrial engineering at his Work Simplification Conferences in Lake Placid New York.
 
Douglas Hartree explains that Herman Goldstein and John von Neumann developed a flowchart (originally, diagram) to plan computer programs. Flowcharts used to be a popular means for describing computer algorithms and are still used for this purpose.

Purpose of a Flowchart:

Suppose if we asked by our teacher to solve an arithmetic problem and we are not familiar with the steps involved in solving that problem. In such a situation we will not be able to solve that problem. The same principle applies while writing computer programs also. A programmer cannot write the instructions to be followed by a computer unless the programmer knows how to solve the program manually.
 
Now suppose we know the steps to solve the problem but while solving the problem if we forget to apply some of the steps or we have applied the calculation steps in the wrong sequence then obviously we will get a wrong answer. Similarly while writing  a computer program if the programmer forget to write some of the instructions or writes the instructions in the wrong sequence then the computer will calculate a wrong answer.
 
Thus we can conclude that it is necessary that every programmer writes each and every instructions in the proper sequence. In order to ensure that the program instructions are appropriate for the problem and are in the correct sequence, programs must be planed before they are written.
 
Hence before writing any computer program, the algorithm and then the flowchart of that program must be written. This is called as two step approach of writing programs.

Algorithm:

The term algorithm may be defined as a sequence of instructions designed in such a way that if the instructions are executed in the specified sequence the desired results will be obtained.
 
See Also:

Procedure to draw a Flowchart:

Normally an algorithm is first represented in the form of a flowchart and the flowchart is then expressed in some programming language to prepare a computer program.
 
The main advantage of this two-step approach in writing programs is that while drawing the flowchart one is not concerned with the details of the elements of programming language.
 
Since a flowchart shows flow of operations in the pictorial form. Thus any error in the logic of procedure can be easily detected that in a case of a program.
 
Once the flowchart is ready the programmer can forget about the logic of the program and can concentrate only on the coding the operations of each box of the flowchart in terms of the programming language. This will ensure an error-free program.

Flowchart Symbols:

As we know that a flowchart uses boxes of different shapes to denote different types of instructions. The communication of programs logic through flowchart is made easier through the use of symbols that have standardized meanings. For example the diamond shape box always mean a decision. Only a few symbols are needed to indicate the necessary operation in a flowchart. These symbols have been standardized by the American National Standards Institute.
Flowchart Symbols

Terminal:

The terminal symbol is used to indicate the beginning (START), ending (STOP), and pause (HALT) in the program logic flow. It is the first symbol in the program logic. In addition, if the program logic calls for a pause in the program then that is also indicated with a terminal symbol. A pause is used normally in a program logic under some error condition.

Input and Output:

The input/output symbol is used to denote any function of an input/output device in the program. If there is a program instruction to input data from a disk, tape, card reader, terminal, or any other type of input device, that step will be indicated in the flowchart with an input/output symbol. Similarly, all output instruction, whether it is output on a printer, magnetic tape, magnetic disk, terminal screen, or any output device, are indicated in the flowchart with an input/output symbol.

Processing:

A processing symbol is used in a flowchart to represent arithmetic and data movement instructions. Thus, all arithmetic processing of adding, subtracting, multiplying, and dividing are shown by a processing symbol. The logic process of moving data from one location of the main memory to another is also denoted by this symbol. When more than one arithmetic and data movement instruction are to be executed consecutively, they are normally placed in the same processing box and they are assumed to be executed in the order of their appearance.

Flowlines:

Flowlines with arrowheads are used to indicate the flow of operation that is the exact sequence in which the instructions are to be executed. The normal flow of flowchart is from top to bottom and left to right. Arrowheads are required only when the normal top to bottom flow is not to be followed. However as a good practice and in order to avoid ambiguity Flowlines are usually drawn with an arrowhead at the point of entry to a symbol. Good practice dictates that Flowlines should not cross each other and that such intersections should be avoided whenever possible.

Decision:

The decision symbol is used in a flowchart to indicate a point at which a decision has to be made and a branch to one of two or more alternative points is possible. In the picture given below shows three different ways in which a decision symbol can be used. It may be noted from these examples that the criterion for making the decision should be indicated clearly within the decision box. During execution the appropriate path is followed depending upon the result of the decision.

Connector:

If a flowchart becomes very long, the flowlines start crisscrossing at many places that causes confusion and reduces understandability of the flowchart. Moreover, there are instances when a flowchart becomes too long to fit in a single page and the use of flowlines becomes impossible. Thus, whenever a flowchart becomes complex enough that the number and direction of flowlines is confusing or it spreads over more than one page, it is useful to utilize the connector symbol as a substitute for flowlines. This symbol represents an entry from, or an exit to another part of the flowchart.
 
A connector symbol is represented by a circle and a letter or digit is placed within the circle to indicate the link. A pair of identically labeled connector symbol is commonly used to indicate a continued flow when the use of a line is confusing. So two connectors with identical labels serve the same function as along flowlines. That is, they show an exit to some other chart section, or they indicate an entry from another part of the chart.
 
How is it possible to determine if a connector is used as an entry point or an exit point? The answer is very simple if an arrow enters but does not leave the connector then it is an exit point and the program control is transferred to the identical connector that has an outlet.
 
It may be noted that connectors are not used to represent any operation and their use in a flowchart is only for the sake of convenience and clarity.

Types of Flow chart:

There are no set standards on the amount of details that should be provided in a flowchart. A flowchart that outlines the main segments of a program or that shows less details is called a Macro Flowchart. On the other hand a flowchart with more details is called a Micro Flowchart or detailed flowchart.

Flowcharting Rules:

As we know that programmers have a good deal of freedom in creating a flowchart but there are a number of general rules and guidelines those must be followed while creating a flowchart. These Rules and Guidelines are recommended by the American National Standards Institute. Various computer manufacturing and data processing departments usually have similar flowcharting standards. Some of these rules and guidelines are as follows:
  1. First chart the main line of logic then incorporate details.
  2. Maintain a consistent level of details for a given flowchart.
  3. Do not chart every details.
  4. Words in a flowchart symbols should be common statements and easy to understand. It is recommended to use descriptive titles written in designer’s own language rather than in machine oriented language.
  5. Be consistent in using names and variable in the flowchart.
  6. Go from left to right and top to bottom in constructing flowchart.
  7. Keep the flowchart as simple as possible. The crossing of flowlines should be avoided as far as practicable.
  8. If a new flowcharting page is needed, it is recommended that the flowchart be broken at an input or output point. Moreover properly labeled connectors should be used to link the portion of the flowchart on the different page.

Advantages of Flowcharts:

Better Communication:

Since a flowchart is a pictorial representation of a program it is easier for a programmer to explain the logic of a program to some other programmer or to his boss through a flowchart rather than the program itself.

Effective Flowchart:

A Macro flowchart that charts the main line of the logic of a software system becomes a system model that can be broken down into detailed parts for study and further analysis of the system.

Effective Synthesis:

A group of programmers are normally associated with the design of big software systems. Each programmer is responsible for designing only a part of the entire system. So initially if each programmer draws a flowchart for his part of design, the flowchart of all the programmers can be placed together to visualize the overall system design. Any problem in linking the various parts of the system can be easily detected at this stage and the design can be accordingly modified. Thus flowcharts are used as working models in the design of new programs and system software.

Efficient Coding:

Once a flowchart is ready programmers find it very easy to write the concerned program because the flowchart acts as a roadmap for them. It guides them to go from the starting point of the program to the final point ensuring that no steps are omitted. The ultimate result is an error free program developed at a faster rate.

Systematic Debugging:

Even after taking full care in program design some error may remain in the program because the designer might have never thought about a particular case. These error are detected only when we start executing the program on a computer. Such type of program errors are called bugs and the process of removing these error is known as debugging.
 
Once a bug is detected it is easier to find out the reason for that bug by going through the logic of the program in flowchart form. A flowchart is very helpful in detecting, locating and removing bugs in a program in a systematic manner.

Systematic Testing:

Testing is the process of confirming whether a program will successfully do all the jobs for which it has been designed under the specified constraints. For testing a program different set of data is fed as input to that program to test the different paths in the program logic.

Limitation of Flowcharts:

In spite of their many obvious advantages, flowcharts have several limitations which are as follows:
  1. Flowcharts are very time consuming.
  2. Owing to the symbols-strings nature of flowcharting, any changes or modification in the program logic will usually require a completely new flowchart.
  3. There are no standards determining the amount of details that should be included in a flowchart.