Java Reference
In-Depth Information
Figure 3-5a shows the pseudocode that represents the logic of the program
requirements. The structure of the program will be sequential in nature, mean-
ing that the computer will perform one action after another without skipping
any steps or making any decisions that would affect the flow of the logic.
Figure 3-5b shows an event diagram that illustrates how the click of the
Calculate button in the applet window triggers the calculation and displays the
answer in the applet window.
Calculate Body Mass Index
get height from user
get weight from user
convert height and weight to metric
calculate index
display index
End
(a)
trigger
User clicks Calculate
button
operation
System receives request
Answers are stored
Answers are stored
Answer is stored
Calculate body
mass index
Get height and
weight input
from user
Convert inches
and pounds to
meters and
kilograms
Display
results
event
Calculate button
receives the focus
operation triggers
no subsequent
event
(b)
FIGURE 3-5
VALIDATE DESIGN Once you have designed the program, you can validate
the design by stepping through the requirements document and making sure
that the design addresses each requirement. If possible, you also should step
through the solution with test data to verify that the solution meets the require-
ments. The user also should review the design to confirm that it solves the prob-
lem outlined in the requirements. By comparing the program design with the
original requirements, both the programmer and the user can validate that the
solution is correct and satisfactory.
 
Search WWH ::




Custom Search