The pseudocode in Figure 3-6 shows two end-structure statements—endif
and endwhile. You can use an endif statement to clearly show where the
actions that depend on a decision end. The instruction that follows if occurs
when its tested condition is true, the instruction that follows else occurs
when the tested condition is false, and any instructions that follow endif
occur in either case—instructions after the endif are not dependent on the if statement
at all. In other words, statements beyond the endif statement are “outside” the
decision structure. Similarly, you use an endwhile statement to show where a loop
structure ends. In Figure 3-6, while conditionF continues to be true, stepG continues
to execute. If any statements followed the endwhile statement, they would be
outside of, and not a part of, the loop. (You fi rst saw the endwhile statement in
Chapter 2.)
The pseudocode in Figure 3-6 shows two end-structure statements—endif
and endwhile. You can use an endif statement to clearly show where the
actions that depend on a decision end. The instruction that follows if occurs
when its tested condition is true, the instruction that follows else occurs
when the tested condition is false, and any instructions that follow endif
occur in either case—instructions after the endif are not dependent on the if statement
at all. In other words, statements beyond the endif statement are “outside” the
decision structure. Similarly, you use an endwhile statement to show where a loop
structure ends. In Figure 3-6, while conditionF continues to be true, stepG continues
to execute. If any statements followed the endwhile statement, they would be
outside of, and not a part of, the loop. (You fi rst saw the endwhile statement in
Chapter 2.)
การแปล กรุณารอสักครู่..