Draw a flowchart for this function: y = x2 + 4x + 3. You can use only the Example: operations of addition and multiplication. You can see that it is not a precise definition of the task. It is not defined how we must compute the function. Hence, we assume in this case that it is possible to calculate the value of the function at once. Therefore, we can depict the following flowchart: The basic structure of "branching" is a branching algorithm. Depending on the result of the check of a condition («Yes» or «No»), it provides the choice one of the alternative paths of the algorithm. Each of the pathways leads to a common output, so that the algorithm will continue regardless of which path is chosen. In the following, we assume the structure "branching" exists in four basic versions: IF-THEN (incomplete branching) IF-THEN-ELSE (full branching) SELECT (incomplete) SELECT-ELSE (full) 1) IF-THEN Pseudocode: IF THEN Decision Activity 1 END-IF Verbal description: If the Decision is true ("Yes"), the following actions(Activity 1) are performed, otherwise the transition to the next step is made at once, if any. The corresponding snippet of a flowchart is: 2) IF-THEN-ELSE Pseudocode: IF THEN Decision Activity 1 ELSE Activity 2 END-IF
Example: Draw a flowchart for this function: y = x2 + 4x + 3. You can use only the operations of addition and multiplication. You can see that it is not a precise definition of the task. It is not defined how we must compute the function. Hence, we assume in this case that it is possible to calculate the value of the function at once. Therefore, we can depict the following flowchart: The basic structure of "branching" is a branching algorithm. Depending on the result of the check of a condition («Yes» or «No»), it provides the choice one of the alternative paths of the algorithm. Each of the pathways leads to a common output, so that the algorithm will continue regardless of which path is chosen. In the following, we assume the structure "branching" exists in four basic versions: IF-THEN (incomplete branching) IF-THEN-ELSE (full branching) SELECT (incomplete) SELECT-ELSE (full) 1) IF-THEN Pseudocode: IF Decision THEN Activity 1 END-IF Verbal description: If the Decision is true ("Yes"), the following actions(Activity 1) are performed, otherwise the transition to the next step is made at once, if any. The corresponding snippet of a flowchart is: 2) IF-THEN-ELSE Pseudocode: IF Decision THEN Activity 1 ELSE Activity 2 END-IF
algorithm_flowchart_pseudocode.docx