Introduction to Flowcharts

A Flowchart is a pictorial way to represent and organize the sequence of steps to address a process scenario. A flowchart visually represents and organizes the steps used to write the program. It is a diagram of the “flow” of a process. When programmers write code, they need to give the computer instructions that are both sequential and specific. Flowcharts enable programmers to work these steps out before writing code.

Typically in the context of computational scenarios, a flowchart is used to help convey the sequence of steps to transform the inputs into the expected outputs so that a computer program can be written from it. There are few conventions to be followed while drawing flowcharts. Couple of the standards available for flowcharts are given in Reference 1 and 2 below. Flowcharts are to be read from start to end as per the flow. The symbols used are shown below:

Flowcharts can be tested for correctness and completeness just like any other work product.

In the following illustrations, a few flowcharts are given to show how to draw and test the flowchart.

Illustrative Scenario: Get a number NUM and compute its factorial FACT

Scenario: Get a list of N numbers from the user and display the maximum, minimum and average of these N numbers

Scenario: Determine the sequence of numbers that will be displayed by the following flowchart

Scenario: Determine if a number entered by the user is a prime number or not

References

  1. Flowcharting with the ANSI Standard: A Tutorial
  2. Flowchart symbols and their usage in information processing