Traditional Culture Encyclopedia - Traditional customs - How to make a program flowchart?
How to make a program flowchart?
Program flow chart consists of processing boxes, judgment boxes, start and stop boxes, connection points, flow lines, comment boxes, etc., and combined with the corresponding algorithms, constituting the entire program flow chart.
The processing box has the function of processing; the judgment box (diamond box) has the function of conditional judgment, there is an entrance and two exits; the start and stop box indicates the beginning or end of the program; the connection point can be connected to the flow line; the flow line (indicates the path and direction of the process; the comment box is for the operation of the flow chart of some boxes to do the necessary supplementary explanation. [3]
The three basic structures of a program flowchart
Any complex algorithm can be composed of three basic structures: sequential, selective (branching), and cyclic, and therefore, an algorithm is constructed using only these three basic structures as the "building blocks," and adhering to the specifications of the three basic structures. Therefore, when constructing an algorithm, only these three basic structures are used as the "building units", and the specifications of the three basic structures are observed. Precisely because the entire algorithm is composed of three basic structures, as if built with modules, so the structure is clear, easy to verify the correctness, easy to correct errors, this method, is the structured approach. Programming that follows this approach is structured programming. Accordingly, you can draw a flowchart of any algorithm as long as you specify how to draw a flowchart of the three basic structures. [4]
(1) Sequential Structure
The sequential structure is a simple linear structure in which the boxes are executed in sequence. The basic shape of its flowchart is shown in the figure, where the statements are executed in the order ABC.[1]
(2) Selection (Branching) Structure
This structure is a judgment of a given condition, where the contents of different boxes are executed respectively when the condition is true or false. There are two basic shapes. [1]
(3) Loop structures
Loop structures have two basic shapes: while-type loops and do - while type loops. a. while-type loops: the execution sequence is: when the condition is true, execute A repeatedly, once the condition is false, jump out of the loop and execute the statement immediately after the loop. b. do - while type loops: the execution sequence is: First execute A, then judge the condition, when the condition is true, keep executing A in a loop, once the condition is false, end the loop and execute the next statement immediately after the loop.
- Previous article:How to use Beijing Carrefour shopping card
- Next article:What festivals does the Youth League eat?
- Related articles
- There is a line of lyrics called Langjun quickly rest ah song title is
- Basics of sealing technology
- Western-style restaurant clothing process characteristics
- What are the classifications of level gauges?
- What are the characteristics of ancient buildings in China?
- All the festivals of the year.
- The Use of Chinese Traditional Culture in Modern Design
- 22-year-old female, massive cerebral infarction after massage, and then what symptoms does the body have?
- Details of biological adhesives
- Present situation and main problems of employee attendance management in enterprises