My Notes Essay

2176 Words Oct 18th, 2014 9 Pages
Chapter 4 – Design Tools: Jackson Structured Programming (JSP)

4.1 Three Structured Constructs

All programs can be constructed using only the three basic constructs. It is the concept of structured programming that a program should be developed using only these three basic constructs. It is not wrong to use the GOTO structure but it is discouraged, because programs with the GOTO structure are often classified as unstructured. The three basic constructs are:

1. Sequence

2. Selection

3. Iteration/Repetition

4.1.1 Sequence Construct

In a sequence construct, the way the statements are placed implies the order in which the computer will execute the statements. The computer will interpret the statements in a
…show more content…
Based on the outcome for the condition(s), only one of the components will be selected. All the other components will not be selected. Consider the following:

Check-Age Module DO IF Age < 21 Then DO Teenage module ENDDO ELSE DO Adult module ENDDO ENDIF ENDDO

When the Check-Age module is activated, the Teenage module will be performed if condition is true (i.e. Age or = 21), then the Adult module will be performed. So, the condition determines which component is to be performed. There will never be the case where both modules are activated in the same run.

Using the JSP method, the Section construct is represented as follows:

Figure 4-3: Simple selection

Take note of the convention. For the selection construct, the process box is slightly different from the normal process box. It has a small circle (“o”) at the top right corner of the process box indicating that it is a selection construct. There is also the condition that must be placed on the left branch of the construct. It can be the actual condition

Related Documents