Java Reference
In-Depth Information
Condition
Case 3 . . .
Case 1
Case 2
Case n
. . .
Action 1
Action 2
Action 3
Action n
Select Case Structure
FIGURE A-11
Flowcharting Tips
The following recommendations can help make flowcharts more efficient and easier for others to
understand. These suggestions assume that the input, processing, and output of the problem are
defined properly in a requirements document.
1. Sketch a general flowchart and the necessary detail flowcharts before coding the problem.
Repeat this step until you are satisfied with your flowcharts.
2. Use the control structures described on pages A.07 and A.08.
3. Put yourself in the position of the reader, keeping in mind that the purpose of the
flowchart is to improve the reader's understanding of the solution to the problem.
4. Show the flow of processing from top to bottom and from left to right. When in doubt,
use arrowheads as required to indicate the direction of flow.
5. Draw the flowchart so that it is neat and clear. Use the connector symbols to avoid
excessively long flowlines.
6. Choose labels for each symbol that explain the function of the symbols in a clear and
precise manner.
7. Avoid endless loops; construct loops so that they will be terminated when specific condi-
tions are satisfied.
The reason that flowcharts are so important is simple: the difficulties in programming lie mostly
in the realm of logic, not in the syntax and semantics of the computer language. In other words, most
computer errors are mistakes in logic, and a flowchart aids in detecting these types of mistakes. For an
additional example of a flowchart, see Figure 1-14 on page 18.
 
Search WWH ::




Custom Search