go to previous page   go to home page   go to next page hear noise highlighting

Answer:

Sometimes. But you should write the structured version first. Keep it, so that when the speedy version turns out to be buggy you have something that works.


Top-down Design

One-block Flowchart

The absolute value problem (two pages back) is an example of Top-down structured design. When using this design method you start with just one program block, and then replace that block with one of the structures: sequence, alternation, or iteration. You then refine the new flowchart by replacing one of its blocks with one of the same structures. You continue replacing blocks with structures until the flowchart has enough detail to work as a program design.

For example, say that you want to design a program that adds up integers entered by the user. The initial design might look like the picture.

(Actually, you would probably do this step conceptually and not actually draw the flowchart.)


QUESTION 20:

Think about how the flowchart could be refined to show more detail. Replace the code block with just one structure.

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