Java Reference
In-Depth Information
If GenderCode = male then
MaleCount = MaleCount + 1
If Age > 21 then
MaleAdultCount = MaleAdultCount + 1
If Balance < 500 then
Display Credit OK
Else
Display Credit not OK
Else
End If
MaleMinorCount = MaleMinorCount + 1
End If
Else
FemaleCount = FemaleCount + 1
If Age > 21 then
FemaleAdultCount = FemaleAdultCount + 1
Else
FemaleMinorCount = FemaleMinorCount + 1
End If
End If
FIGURE A-12
FIGURE A-13
7. For the Do While structure, use the following conventions:
a. If the structure represents a counter-controlled loop, begin the structure with Do.
b. If the structure does not represent a counter-controlled loop, begin the structure with
Do While.
c. Specify the condition on the Do While or Do line.
d. Use End Do as the last statement of the structure.
e. Align the Do While or Do and the End Do vertically.
f. Indent the statements within the loop.
The conventions for the Do While structure are illustrated in Figures A-14 and A-15 on the next
page. (Java implements the structure in code with the keywords, do and while.)
8.
For the Do Until structure, use the following conventions:
a. Begin the structure with Do Until.
b. Specify the condition on the Do Until line.
c. Use End Do as the last statement of the structure.
d. Align the Do Until and the End Do vertically.
e.
Indent the statements within the loop.
Search WWH ::




Custom Search