go to previous page   go to home page   go to next page

Answer:

If the big block entry conditions are correct, then the big block exit conditions are correct.


Structure Rule Two: Sequence

structure rule two

A sequence of blocks is correct if the exit conditions of each block matches the entry conditions of the following block. Control enters each block at the block's entry point, and leaves through the block's exit point. The whole sequence can be regarded as a single block, with an entry point and an exit point.

Rule 2 of Structured Programming: Two or more code blocks in sequence are structured.

Ultimately, if the program is a sequence of small blocks that fit together properly, the entire program could be thought of as one big block. When the program's entry conditions are met, then the program's exit conditions will be met.

With a program, the entry conditions consist of the problem the program was written to solve, and the exit conditions are the solution to the problem. If each of the blocks of the program are correct, then the entire program is correct.


QUESTION 9:

Are if-then-else structures possible in structured code?