Java Reference
In-Depth Information
Start
Initialization
Counter = 0
Accept First
Inventory
Record
Display
Value of
Counter
Yes
End-of-File
End
No
Increment
Counter by 1
Accept Next
Inventory
Record
FIGURE A-6
Control Structures
The logic of almost any procedure or method can be constructed from the following three basic logic
structures:
1. Sequence structure
2. If…Then…Else or Selection structure
3. Do While or Repetition structure
The following are two common extensions to these logic
structures:
Do Until (an extension of the Repetition structure)
Select Case (a multiple choice extension of the Selection
structure)
The Sequence structure is used to show one action or one
action followed by another, as illustrated in Figures A-7a and
A-7b. Every flowchart in this topic includes this control structure.
Action 1
Action 1
(a)
Action 2
(b)
Sequence Structure
FIGURE A-7
Search WWH ::




Custom Search