Please enable JavaScript.
Coggle requires JavaScript to display documents.
CONTROL FLOWS - Coggle Diagram
CONTROL FLOWS
Composition
- Helps make control statement design easier
- Statements are written in the order in which they are to be executed.
- Design Issues
-Multiple Entry Points : Only possible if language already includes goto statements and labels
-Multiple Exit Points
- GOTO statement
-most powerful statement for controlling the flow of execution.
-Improper usage may result in highly unreadable and difficult to maintain programs
- Label
-an explicit name or number (variable) assigned to a
fixed position within the source code
Selection
-
Two Way Selection
Design Issues
- What is the form and type of the expression that controls the selection?
- Can a single statement, a sequence of statements, or a compoundstatement be selected?
Nesting Selectors
- Can be interpreted in two different ways depending on whether the else clause is matched with the first then clause or the second
- This issue solved by
-Providing a rule
-Providing a syntactic form
-Selection Closure
N-Way Selection
- A generalization of a selector
Design Issues
- What is the form and type of the expression that controls the selection?
- Is the entire construct encapsulated in a syntactic structure?
- Is execution flow through the structure restricted to include just a single selectable segment ?
- Is there a “default” clause for unrepresented selector values
Iteration
-
Design Issues
- How is the iteration controlled ?
- Where should the control mechanism appear in the loop?
- What is the type and scope of the loop variable?
- What values does the loop variable have at loop termination ?
- Should it be legal for the loop variable or loop parameters to be changedin the loop, and if so, does the change affect loop control?
Iterative Statements
-
-
- Logically Controlled Loops
- User-Located Loop Control Mechanism
- Iteration based on data structures
- User-Defined Iteration Control