High school mathematics compulsory 3 program block diagram knowledge points
The concept of program block diagram:
Program block diagram, also known as flow chart, is a kind of graph that uses program blocks, flow lines and text descriptions to represent the algorithm;
Composition of program block diagram:
The program block diagram includes the following parts: corresponding program blocks to realize different algorithm functions; Streamlines with arrows; Necessary explanatory text in the program box.
Steps to design program block diagram:
The first step is to express the algorithm steps in natural language;
Secondly, the logical structure of each algorithm step is determined and represented by the corresponding program block diagram to obtain the program block diagram of this step;
Thirdly, the program block diagrams of all steps are connected by pipeline, and a junction box is added to get the program block diagram representing the whole algorithm.
Rules for drawing program block diagram:
(1) Use standard block diagram symbols;
(2) The block diagram is generally drawn from top to bottom and from left to right;
(3) Except for the judgment box, the program box in most program block diagrams has only one entry point and one exit point, and the judgment box is the only symbol with more than one exit point;
(4) The language described by graphic symbols should be very concise and clear.
Several important structures:
Sequence structure, conditional structure, cyclic structure.
Knowledge points of three compulsory sentences in senior high school mathematics
Input statement:
The INPUT statement on line 1 in this program is the input statement. The general format of this statement is:
Among them,? Prompt content? What kind of information is usually prompted to the user. If you input -5, -4, -3, -2,-1, 0, 1, 2, 3, 4, 5 in turn every time you run the above program, the computer will assign the newly input value to the variable every time. x? , and then press? x? The newly obtained value executes the following statement.
Output statement:
In this program, the PRINT statements on lines 3 and 4 are output statements. Its general format is:
Like an input statement, an expression can be preceded by? Prompt content? .
Transfer statement:
A statement used to indicate that a specific definite value is assigned to a variable.
In addition to the input statement, the assignment statement in the second line of this program can also provide the initial value for the variable. Its general format is:
In the assignment statement? =? This is called the job number.
Function of algorithm statement:
The function of input statement: input information.
The function of output statement: output information.
The function of assignment statement: first calculate the value of the expression on the right of assignment number, and then assign this value to the variable on the left of assignment number, so that the value of this variable is equal to the value of expression.
Conditional cycle knowledge points of compulsory 3 courses in senior high school mathematics
Conditional statement:
The conditional structure in the algorithm is expressed by conditional statements.
Loop statement:
In some algorithms, a certain processing step is repeatedly executed from the beginning according to certain conditions, which is the circular structure.
Repeated processing steps are called loop bodies.
General format of conditional statements:
(IF-THEN-ELSE format)
When the computer executes the above statement, it first judges the condition after IF, and if the condition is met, it executes the statement after THEN 1, otherwise it executes the statement after ELSE 2.
Form of circular structure:
Left, judge first and then execute. First, it is judged whether the specified conditions are established. If the condition is true, the loop condition is executed. If the condition is false, exit the loop.
On the right, execute first, then judge, execute the loop body first, and then check whether the condition is established. If not, repeat the loop body until the condition is established and exit the loop.