How to draw a program flowchart

Source: Internet
Author: User
Tags documentation

Look at the PST code many days, the reading and writing process inside read, and forget, look again, and then forget, blame the poor and readability of the notes, today began to learn flow chart.

The following describes the standard procedure flowchart symbols and the use of the Convention

One, Introduction

The program flowchart (Progran flowchart), as an algorithm expression tool, has long been a familiar and common use for computer workers and computer users. However, one of its obvious drawbacks is the lack of a unified standardized notation and strict rules of use. Recently, National Standards Bureau approved national Standards (GB1525-89) << Information Processing-Data flow chart, program flow chart, System flow chart, program Network Diagram and system resource diagram documentation symbols and conventions >> We recommend a set of standardized symbols and usage conventions. Since the standard is published with the ISO standard iso5807--85 information processing--documentation symbols and comventions for The Data,program and System Flowcharts,program Network charts and system resources charts are identical, which is abstracted from the part of the program flowchart and explains For readers ' reference.

The program flow chart drawn from this standard is called a standard flowchart.

Second, the symbol

The program flowchart represents the order in which the program is operated. It should include:

(1) Indicates the processing symbol for the actual processing operation, including the symbol that determines the path to be executed according to the logical conditions.

(2) Indicate the streamline symbol of the control flow.

(3) Easy to read and write program Flowchart special symbols.


The symbols used in the standard flowchart and their brief descriptions are given below, see Figure 1.

Figure 1 Standard program flowchart symbols

1. Data----A parallelogram indicating data, which may indicate a data name, source, purpose, or other textual description. This symbol does not qualify the media for the data.

2. Processing----rectangles represent a variety of processing functions. For example, perform a specific operation or set of actions that change the value of the information, the shape of the information, or the location of the message, or determine the selection of a flow. A rectangle can be marked with a processing name or its simple function.

3. Specific processing----rectangles with double vertical lines represent named specific processing. The process is an operation or a set of operations that has been described in detail in another place, such as a subroutine, a module. A rectangle can indicate a specific processing name or its brief function.

4. Prepare----hexagon symbol. It means modifying an instruction or a set of instructions to affect subsequent activities. For example, set up a switch, modify the address register, initialize the routine.

5. Judge-----Diamond to indicate judgment or switch. A diamond can indicate the condition of judgment. It has only one entry, but it can have several alternative exits, one and only one exit is activated after the definition of the folding condition is evaluated within the symbol. The result can be written near the streamline that represents the exit path.


6. Cyclic boundary----cyclic bounds for the upper corner rectangle to represent the year boundary and the lower boundary of the lower corner rectangle, respectively, representing the beginning of the cycle and the end of the cycle. Fig. 22 The Loop representation of

A pair of symbols should be marked with the same cyclic identifier. Depending on the test termination cycle condition at the beginning of the loop or at the end of the loop, the condition is indicated in the upper boundary character (e.g., when a>b) or in the lower bound character (e.g., until c<d). Figure 2 shows two different representations that enter the loop when the termination condition is established and the exit loop until the termination condition is established.

7. The connector----circle represents the connector, it is used to indicate the direction of the flow chart, or to transfer it from the flowchart. It is a breakpoint on the streamline. Indicate an identifier in the diagram indicating that the streamline will continue at another connector with the same identifier (see the following conventions for connector use).

8. End-point character----flat Circle represents an endpoint that moves to the external environment or from an external environment. For example, the start or end of a program flow, and the external use of the data from the start or end point.


9. The callout----The callout is made up of a vertical line and dotted lines to identify the contents of the annotation. The dotted line must be connected to the annotated symbol or combination of symbols. The body of the note should be close to the longitudinal edge. See Figure 3 for the use of the callout symbol.

Figure 3 Use of the annotation character

10. Streamline-----Line to indicate the flow of control flows. The arrows that represent flow on the streamline, see the following conventions for how to use them.

11. Dashed----dashed lines are used to indicate that the range or connection of the annotation is annotated and the annotated body, also see figure 3.


12. Ellipsis----If some parts of the flowchart do not need to give the specific form and number of symbols, you can make an ellipsis of three points. Ellipses should be sandwiched between streamline symbols or streamline symbols, see figure 4.

Figure 4 Use of ellipses


13. Parallel mode----A pair of parallel lines represents the simultaneous operation of two or more parallel ways. Examples of parallel methods are shown in Figure 5, where processing of a is completed before C,d and e are processed, and the processing of f is done after processing b,c,d is completed. But processing C can be handled D start and/or Start and/or end before the end.

Figure 5 Example of a parallel approach

Third, the use of the contract

For the use of flowchart symbols, a brief description of the following points:

1. The layout of the diagram

The symbols used in the flowchart should be carefully distributed, the lines maintained at reasonable lengths, and the length of the line used as little as possible.

2. The shape of the symbol

The blanks in the majority of symbols in the flowchart for annotation descriptive text. The use of various symbols should pay attention to the shape of the symbol and the unity of the size of the symbols, to avoid the symbol deformation or different proportions of the size of the symbols.

3. Explanatory text within the symbol

The descriptive text within the symbol should be made as concise as possible. It is usually written from left to right and from top to bottom, and is not related to flow. If the description is more text, the symbol can not be written out, use the callout character. If the callout interferes with or affects the graphics process, the body should be written on another page with the reference symbol marked.

4. Symbol identifier


The identifier is specified for the symbol in order to make it easier for other files to refer to the symbol. As it is, the list of programs refers to specific symbols in the flowchart. The symbol identifier is generally written in the upper-left corner of the symbol, as shown in Figure 6 (a).

Figure 6 symbol identifier and symbol descriptor

5. Symbol Descriptor

To facilitate further understanding of the function of the symbol, you can annotate the symbol descriptor. The descriptor is usually written in the upper-right corner of the symbol, as shown in Figure 6 (b).

6. Detailed representation


Draw a horizontal line in the process symbol or data symbol, indicates that the symbol has a more detailed representation of the other words in the same set of documents. The horizontal line is near the item end within the symbol, and the detailed identifier is written above the symbol's horizontal line, as shown in Figure 7 (a). The endpoint character is used as the start and end symbol for detailed representations, The identifier in the dash symbol should be given in this symbol, as shown in Figure 7 (b).

Fig. 7 Dash symbol and its detailed representation

7. Streamline

(1) Standard flow and use of arrows

The standard flow of streamline is from left to right and from top to bottom. Streamline flow along standard flows can be used without arrows to indicate direction, but the flow along the non-standard flow line applies arrows indicating the direction of the charge.

(2) Streamline of the intersection

You should try to avoid the crossover of streamline. Even if there is a streamline crossover, there is no logical relationship between the crossover streamline and does not have any effect on the flow, as shown in Figure 8 (a).

(3) The collection of streamline


Two or more entry lines can be assembled into an output line, at which point the connection points should be working with each other to improve clarity, and the arrows indicate the flow, as shown in Figure 8 (b).

Fig. 8 The intersection of Chinese line and the collection of streamline

(4) Symbol streamline access

In general, the streamline should be entered from the left or the end of the symbol and left from the right or bottom. Its access points should be aligned to the center of the symbol.

(5) Connectors

To avoid streamline crossover and long lines, or a flowchart that can be extended on another page, the available connectors truncate the streamline. The connector at the beginning of the truncation is called the exit connector, and the connector at the end of the break is called the entry connector. Two connectors with the same identifier.


A page break can be expressed as a callout that is connected to a connector, as shown in Figure 9.

Figure 9 Exit Connectors and entry connectors

8. Two ways to express multiple export judgments

(1) directly from the judgement symbol to draw a number of streamline, as shown in the figure (a).


(2) Draw a line from the judgement symbol, and then lead a number of lines from it, as shown in figure (b).

Figure 10 Multiple export judgments


Each exit for multiple export judgments is bid with a corresponding conditional value to reflect the logical path it leads to, as shown in Figure 11.

Fig. 11 to mark out the condition value at export of multiple export judgments


Four, example

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.