It is important to clearly describe logical control structures that involve branching away from the simple sequential flow of steps and the conditions upon which they are based. Outlines are well suited to this task because of the hierarchical nature of their lettered and numbered steps. Analysts often employ indentation using tabs or spaces to help clarify step subordination. If your rendering software cannot indicate the presence of such "whitespace" characters, be give careful attention to the labeling of the steps to determine the subordination of the steps.
Note: in the document below, "[CR]" represents the carriage return and/or line feed sequence necessary to start a new line of output.
A. Start "Leading Decision Counting Loop Example"
B. Assign the value First into C.("Initialization of the counter")
C. While C is less than or equal to Final ("Test for passage/exit"), do a loop pass:
C.1. Display the value in C and a [CR]. ("Loop body")
C.2. Increase C by the value in Step. ("Loop increment")
C.3. Go back to loop test. ("Loopback")
D. End
The steps above contain the four parts found in every counting controlled loop. These are:
The list below is an alternative to the traditional columnar Tracing Chart used to track the values of data items as they are stored in main memory and to track the true or false results of conditional tests within an algorithm. Each line below indicates a change to one of those items in the format "Identifier or condition: value or result". The order of the lines below indicates the order in which the changes occurred. These should be studied in combination with the Test Softcopies shown on the An Example of a Counting Loop (Repetition Structure).
C: 1 C <= Final: True C: 1 C <= Final: True C: 2 C <= Final: True C: 3 C <= Final: True C: 4 C <= Final: True C: 5 C <= Final: True C: 6 C <= Final: False
It is important to clearly describe logical control structures that involve branching away from the simple sequential flow of steps and the conditions upon which they are based. Outlines are well suited to this task because of the hierarchical nature of their lettered and numbered steps. Analysts often employ indentation using tabs or spaces to help clarify step subordination. If your rendering software cannot indicate the presence of such "whitespace" characters, be give careful attention to the labeling of the steps to determine the subordination of the steps.
Note: in the document below, "[CR]" represents the carriage return and/or line feed sequence necessary to start a new line of output.
A. Start "Trailing Decision Counting Loop Example"
B. Assign the value First into C. ("Initialization of the counter")
C. Do a loop pass:
C.1. Display the value in C and a [CR]. ("Loop body")
C.2. Increase C by the value in Step. ("Loop increment")
C.3. If C is less than or equal to Final ("Test for passage/exit"), do another pass.
D. End
The steps above contain the four parts found in every counting controlled loop. These are:
The list below is an alternative to the traditional columnar Tracing Chart used to track the values of data items as they are stored in main memory and to track the true or false results of conditional tests within an algorithm. Each line below indicates a change to one of those items in the format "Identifier or condition: value or result". The order of the lines below indicates the order in which the changes occurred. These should be studied in combination with the Test Softcopies shown on the An Example of a Counting Loop (Repetition Structure).
C: 1 C: 2 C <= Final: True C: 3 C <= Final: True C: 4 C <= Final: True C: 5 C <= Final: True C: 6 C <= Final: False