Mindmap
Estructuras de control selectivas
Inhalt der Mindmap
Estructuras de control selectivas
It is used to make logical decisions, a condition is evaluated and a function is fulfilled, a certain sequence of instructions is carried out. These structures are classified as: Simple, Double, Multiple.
- Simple
- They are identified because they are composed of only one condition. The if-then structure evaluates the condition and in such a case: If the condition is true, then execute the action Yes. If the condition is false, nothing is done.
- syntax if <Condition> hen <Action> End_if
- They are identified because they are composed of only one condition. The if-then structure evaluates the condition and in such a case: If the condition is true, then execute the action Yes. If the condition is false, nothing is done.
- Double
- They are logical structures that allow controlling the execution of several actions and are used when you have two options of action, because of the nature of these you must execute one or the other, but not both at the same time, that is, they are mutually exclusive.
- syntax if <condición> then <Acción S1 > else <Acción S2> End_if
- They are logical structures that allow controlling the execution of several actions and are used when you have two options of action, because of the nature of these you must execute one or the other, but not both at the same time, that is, they are mutually exclusive.
- Multiple
- Applying the multiple decision structure will evaluate an expression that can take n different values, 1, 2, 3, ...., N and depending on whether you choose one of these values in the condition, one of the n actions will be done or what is equal , the flow of the algorithm will follow only a certain path between the n possible. This structure is represented by a selector which if it takes the value 1 will execute action 1, if it takes the value 2 it will execute action 2, if it takes the value n it will perform the action n.
- syntax switch (selector) { case 1: Action 1 break; case 2: Action 2 break; case n: Action n break; default: Excepción; break; }
- Applying the multiple decision structure will evaluate an expression that can take n different values, 1, 2, 3, ...., N and depending on whether you choose one of these values in the condition, one of the n actions will be done or what is equal , the flow of the algorithm will follow only a certain path between the n possible. This structure is represented by a selector which if it takes the value 1 will execute action 1, if it takes the value 2 it will execute action 2, if it takes the value n it will perform the action n.
- Selective control structures allow to "select" an alternate route to solve the problem, depending on the result of evaluating a relational and / or logical expression.
- Simple
Informationen
- Beschreibung
- Mindmap am Estructuras de control selectivas, erstellt von Alan Garcia am 21/02/2019.
- Erstellt von
- Alan Garcia
- Aufrufe
- 1
- Bewertung