Flowchart
A flowchart is a representation of a decision sequence or algorithm. This is a series of pictures that show how to proceed in order to solve a problem. Purpose of a flowchart is to show the flow of the program. The function is to show the steps of decision sequence or algorithm in the form of diagram.
Flowcharts have to be drawn using several geometric figures of different shapes. It helps to understand the nature of the program. Programmers use these charts of flows to compose programs.
Characteristics of Flowchart
- Easily understand the purpose of the program.
- Helps diagnose program errors.
- Assists in program writing.
- Assists in program modification and enhancement.
- It helps in writing complex programs easily and concisely.
Examples
- Draw the flow chart of the process of compiling and running a C program
- Draw the flowchart of a multifunction program
Sample Flowchart
A sample flowchart of a computer program where the program asks user to enter his/her birthdate. Then the program calculates age. If age is less than or equal to 18, then the program outputs that You are a teen, otherwise it outputs that You are an adult.
Components/Elements of Flowchart
Flowchart is drawn with some specific shapes with specific purposes. Following is a list of those shapes with their purposes.
Start/Stop
Use this symbol as the starting or ending point for your flowchart. Write no logic or anything in it, just write Start in case of starting point, otherwise write Stop
Stop/Terminator
Use this symbol as the ending mark for your flowchart. Use similarly as start/stop
Display/Output
Use this symbol when you want to display your program’s output or a prompt text or result of calculation etc. to user
Manual/User input
Use this symbol when your program takes input from user. For example, in the above sample flowchart, our program takes the birthdate as input from user
Predefined Process
Use this symbol when your program performs some operation or calls a function perform some predefined operations. For example, in the sample flowchart, the program performs 2 predefined operations, it sanitizes the user input and calculates the age from given birthdate. We do not want to show the flowchart for sanitizing user input and calculating age from birthdate in this flowchart, so we only mention them as predefined process instead of drawing their flowcharts
Decision
In your program, where you need to decide something, that is, where you use IF condition statements, there you use this Decision symbol.
Rules for Creating Flowchart
- Flowchart should contain conventional symbols.
- Arrows should indicate flow from top to bottom or left to right.
- When designing, the fewer the connection symbols, the better.
- It should be easy to understand.
- It should not be written in a specific programming language.
- If the marks are small or big, there is no damage, but the shape should be correct.
- Designer must write comments where need with marks.
- Multiple flow lines intersect but do not imply any logical relationship between them.
- Designer must use separate flowchat for parts of one flowchart that requires detail description.
- It should be drawn on one page as far as possible. If more than one page is required, the previous page should be marked as used for the pre-determined process.