Java Reference
In-Depth Information
SumFirst100Integers Procedure
Sum = 0
Do Integer = 1 to 100
Sum = Sum + Integer
End Do
Display sum
EmployeeFileList Procedure
Display report and column headings
EmployeeCount = 0
Accept first Employee record
Do While Not End-of-File
Add 1 to EmployeeCount
Display Employee record
Accept next Employee record
End Do
Display EmployeeCount
End
End
FIGURE A-14
FIGURE A-15
The conventions for the Do Until structure are illustrated in Figure A-16. (Java implements the
structure in code with the keywords, do and until.)
SumFirst100Integers Procedure
Sum = 0
Integer = 1
Do Until Integer >100
Sum = Sum + Integer
Integer = Integer + 1
End Do
Display Sum
End
FIGURE A-16
Search WWH ::




Custom Search