Flowchart
A flowchart illustrates the sequence of operations needed to solve a given problem. A flowchart can be likened to a building blueprint or an aircraft blueprint. As we know, an aircraft designer creates a blueprint before starting the construction of an airplane. Similarly, an analyst or an algorithm designer prefers to create a flowchart to help non-technical individuals or programmers understand the process before the programmer writes it into code. A flowchart is a graphical or pictorial representation of a process. The main purpose of all flowcharts is to communicate how a process works without relying on technical jargon or terminology understood only by specific groups.
Flowcharts represent algorithms in the form of designs and symbols, serve as documentation, and are later translated into program code. Flowcharts are generally created during the early stages of program development to provide a visualization of the workflow of a computer program. The presence of a flowchart helps programmers logically understand the existing problems and the intended goals, even when the problem is quite complicated and complex. Once a flowchart is created, it becomes much easier for programmers to translate it into a program using any programming language. Program code written by someone else without documentation in the form of a flowchart or any other format can often be difficult to understand. Conversely, explaining or understanding a flowchart is much easier, no matter how complex the problem.
Below is an example of an algorithm for finding speed and acceleration. As we know, the formula for speed is:
The flowchart for finding velocity step-by-step using the following symbols:
Not every process needs to be represented as a symbol in a flowchart. Some processes can be combined if they share the same steps. For example, in the process of displaying values in the flowchart above, several steps are merged into one — namely displaying both velocity and acceleration together — and the same applies to combining the symbols for velocity (v) and acceleration (a). However, when the flowchart is translated into program code in a specific programming language, each command must be executed one by one.
A. Advantages of Using Flowcharts
-
Communication: A flowchart is a better way to communicate the logic of a system to all involved parties.
-
Effective Analysis: With the help of flowcharts, problems can be analyzed more effectively.
-
Documentation: A program flowchart serves as good program documentation, which is necessary for various purposes.
-
Efficient Coding: Flowcharts act as a guide or blueprint during the system analysis and program development phases.
-
Proper Debugging: Flowcharts help in the debugging process because, from the start, we have a detailed understanding of the issues and what needs to be done.
-
Efficient Program Maintenance: Maintaining operational programs becomes easier with the help of flowcharts. It helps programmers focus their efforts more efficiently.
B. Limitations of Using Flowcharts
-
Complex Logic: Sometimes, the program logic is too complex to be visually expressed, making it difficult to present the process in a flowchart (creating an additional heavy task). Some programmers prefer to write the program directly after communicating with the user instead of waiting for an analyst’s flowchart.
-
Changes: If changes are needed, the flowchart might require a complete redesign (including changes to flowchart symbols).
-
Reproduction: Since a flowchart consists of graphical symbols, it cannot be easily typed out, which poses a challenge in duplication.
C. Flowchart Symbols
-
Input
-
Branching (usually using
ifandswitchcommands) -
Looping (usually using
while,for,each, orloopcommands) -
Output
Flowcharts are usually drawn using several standard symbols. However, it is not prohibited to include non-standard symbols when necessary, depending on the specific design requirements. The standard symbols we often use include the following:
-
Terminator: An oval-shaped symbol indicates the start or end of a process, usually containing the words "Start" or "End."
-
Preparation: Used for preparing storage or declaring a variable needed in a process.
-
Process: A rectangular flowchart symbol that indicates a normal/generic process step. For example, "Calculate acceleration v = s/t."
-
Decision: A diamond-shaped symbol represents a branch in the process flow. This symbol is used when a decision must be made, usually a Yes/No or True/False question.
-
Connector: A small labeled circle used to indicate a jump in the process flow. Connectors are typically used in complex diagrams or when the flow spans more than one page.
-
Data (Input/Output): A parallelogram-shaped symbol representing the input or output of data (I/O) for a process. Example: Get X from the user, Display X.
-
Delay: Used to indicate a delay or a wait for input from another process.
-
Arrow: Used to indicate the control flow in a process. An arrow originating from one symbol and ending at another indicates that control passes to the symbol pointed to by the arrow.
The symbols above are the basic symbols commonly used. Now, the basic guidelines for drawing a flowchart using these symbols are:
-
When drawing an accurate flowchart, all required steps must be included in a logical sequence.
-
The flowchart must be neat, clear, and easy to follow. There should be no room for ambiguity in understanding the flowchart.
-
A flowchart should be read from left to right or from top to bottom.
-
A process symbol should have only one outgoing flow line.
-
For a decision symbol, only one flow line can enter, but two flow lines must exit, indicating the two possibilities (True/False).
-
A terminal symbol should have only one flow line.
See the flowchart below, which includes almost all the basic symbols mentioned.
Below is an example case followed by a solution described in free language and a flowchart.
Reading the solution above requires careful attention.
Case solution using a flowchart:
- KANA, Algorithm and Programming, 2024












No comments:
Post a Comment