How to draw a program flowchart

Source: Internet
Author: User

I remember using a program flowchart when writing a document. When it comes to the process, I think it should be a diagram describing what to do first and then what to do. Then I searched the internet and found that the program flow chart is also very exquisite. I have my own rules. Next I will introduce some of the knowledge I should know before drawing the program flow chart.


What is a flowchart first?


A flowchart is a graph of an algorithm with a specific graphic symbol.

In other words, the program flow chart indicates the Operation Sequence of the program. It should include:

(1) indicate the processing symbols for the actual processing operation, including the symbols for determining the path to be executed according to the logical conditions.

(2) indicates the flow line symbol of the control flow.

(3) special symbols that facilitate reading and writing program flowcharts.


Next, let's look at the symbols used to plot the flowchart.


The following is a brief description of the symbols used in the standard flowchart.


1. Data ---- parallelogram indicates data, which can indicate the data name, source, purpose, or other text description. This symbol does not limit the data media.

2. processing ---- rectangle indicates various processing functions. for example, execute one or more specific operations to change the information value, information world, or location, or determine the choice of a first-class direction. the processing name or simplified function can be indicated in the rectangle.

3. specific processing-a rectangle with double vertical edges indicates a specific processing with a name. this process is an operation or a group of operations that have been described in detail elsewhere, just like a sub-routine, module. the specific processing name or its brief function can be indicated in the rectangle.

4. Prepare ---- the hexagonal symbol indicates preparation. It indicates modifying an instruction or a group of commands to affect subsequent activities. For example, setting the switch, modifying the address register, and initializing the routine.

5. judgment ----- diamond indicates judgment or switch. conditions for judgment can be specified in the diamond. it has only one entry, but there can be several available exits. After the discount condition is defined in the symbol, one and only one exit is activated. the result can be written near the streamline indicating the exit path.

6. cyclic boundary-the circular boundary is a non-repeating rectangle that represents the annual boundary and the bottom boundary of the dedividing rectangle, respectively indicating the start of the loop and the end of the loop. is the expression of two types of loops:

The same cycle identifier should be specified in a pair of symbols. you can check whether the condition for terminating the cycle is at the beginning or at the end of the cycle, and specify the condition in the upper limit, for example, when a> B) or enter it in the lower line (for example, until C <D ). the following two types of expressions are displayed: Enter the loop when the condition is terminated and exit the loop when the condition is terminated.

7. the connector ---- circle indicates the connector, used to indicate it of the steering flowchart, or transferred from it. it is the breakpoint of the streamline. indicate an identifier in the figure, indicating that the streamline will continue at another connector with the same identifier

8. endpoint character ---- flat circle indicates the endpoint character that is transferred to or from the external environment. For example, the start or end of the program flow, and the start or end point is used for the external data.

9. annotation operator ---- the annotation operator is composed of a vertical edge and a dotted line to identify the content of the annotation. the dotted line must be connected to the annotated symbol or symbol combination. the text of the annotation should be near the vertical edge, for example:


10. Streamline ----- a straight line represents the flow line of the control flow. For more information about the arrows that indicate the flow direction on the flow line, see the subsequent conventions.

11. dotted line ---- dotted line is used to indicate the scope or connection of the annotation and the annotation body, such


12. omitted characters-if some parts of the flowchart do not require the specific form and quantity of symbols, they can be omitted by three points. The omitted characters should be placed between the streamline symbols or streamline symbols, such:

13. parallel Mode-a pair of parallel lines indicates that two or more parallel operations are performed simultaneously. an example of the parallel mode is as follows. In the figure, C, D, and E can be processed only after processing a is complete. Similarly, processing F can be performed after processing B, C, and D. however, when processing C, you can process D or before or after C.



The following is the usage convention.


1. Graph Layout

The symbols used in the flowchart should be evenly distributed, the connections should be reasonably long, and the long lines should be used as little as possible.

2. symbol shape

The white space in most symbols in the flowchart is used to mark descriptive text. When using various symbols, pay attention to the uniformity of the shape and size of each symbol to avoid deformation of the symbol or the ratio of each symbol.

3. description text in the symbol

The explanatory text in the symbol should be as concise as possible. it is usually written from left to right and from top to bottom, and has nothing to do with the flow direction. if there are many explanatory text and there is no end to writing in the symbol, you can use the annotator. if the annotator interferes with or affects the graphic process, you should write the text on another page with a reference symbol.

4. Symbolic identifier

The identifier specified for the symbol is to make it easier for other files to reference the symbol. For example, the specific symbol referenced in the flowchart in the program list. The symbol identifier is generally written in the upper left corner of the symbol, see ()



5. symbol Descriptor

To facilitate further understanding of the symbol function, you can mark the symbol descriptor. Generally, the descriptor is written in the upper right corner of the symbol, as shown in (B.

6. Detailed Representation


Draw a horizontal line in the processing symbol or data symbol, indicating that the symbol has a more detailed representation in other languages in the same file set. the horizontal line is near the item end in the symbol. The detailed identifier is written above the horizontal line in the symbol. See (). the endpoint is used as the start and end symbols in detail. The identifier in the dash symbol should be provided in this symbol, as shown in figure (B ).

7. Streamline

(1) use of standard flow direction and Arrow

The standard flow direction of a streamline is from left to right and from top to bottom. You can use arrows to indicate the flow direction along the standard flow, but use arrows to indicate the flow direction along the non-standard flow.

(2) Streamline crossover

Avoid streaming lines as much as possible. Even if there is a streaming line crossing, there is no logical relationship between the crossover lines and there is no impact on the flow direction, as shown in (.

(3) streamline collection

Two or more incoming lines can be integrated into one output line. At this time, the connection points should be wrong to improve clarity and use arrows to indicate the flow direction, as shown in (B.

(4) symbol streaming in and out

In general, the streamline should enter from the left or item side of the symbol and exit from the right or bottom. Its entry and exit points should be aligned with the center of the symbol.

(5) connector

To avoid streamline crossover and use of long lines, or a flow chart can be continued on another page, you can use a connector to cut the streamline. the connector that truncates the start end is called the exit connector, and the connector of the end is called the entry connector. the two connectors use the same identifier. as shown in, page feed truncation can be represented by the annotation that can be connected to the connector, as shown in.

8. Two Representation Methods for multi-exit judgment

(1) multiple flow lines are directly derived from the judgment symbol, such as ()

(2) draw lines from the judgment symbol and then draw lines from it, as shown in (B.


Each exit of Multi-exit judgment should be marked with a corresponding condition value to reflect the logical path it leads.


I have learned so much about program flowcharts. I believe that with these, coupled with your exercises, you will surely draw a beautiful and clear flowchart, however, it is certainly impossible to say no to practice. In every practice, find skills, find rules, and find perfection.

For more information, see: http://rong1224017082.blog.163.com/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.