Skip to content

Commit 6488c51

Browse files
authored
Merge branch 'master' into tanto259-patch-1
2 parents bbe2476 + 85e18a8 commit 6488c51

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

COBOL Programming Course #2 - Learning COBOL/COBOL Programming Course #2 - Learning COBOL.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1777,9 +1777,8 @@ In this example, we are using the PERFORM keyword in a way that is similar to a
17771777

17781778

17791779
```JAVA
1780-
for(int counter =0; counter<11; counter++){
1781-
//move counter to msg-to-write
1782-
//write print-rec
1780+
for (int counter = 1; counter < 11; counter++) {
1781+
System.out.println("The number is: " + counter);
17831782
}
17841783
```
17851784
*Example 4. Java example*
@@ -2011,10 +2010,10 @@ Adding the UNTIL keyword to a perform sentence allows you to iterate over a grou
20112010
This would be equivalent to the Java code:
20122011

20132012
```JAVA
2014-
while(counter != 10){
2015-
//counter++
2016-
//move counter to msg-to-write
2017-
//write print-rec
2013+
int counter = 0;
2014+
while (counter != 10) {
2015+
counter++;
2016+
System.out.println("The number is: " + counter);
20182017
}
20192018
```
20202019
*Example 14. Java while loop*
@@ -2035,12 +2034,11 @@ In this case, the Boolean condition is evaluated before the loop is executed. H
20352034
This would be similar to a "do while" loop in Java:
20362035

20372036
```JAVA
2038-
do{
2039-
//counter++
2040-
//move counter to msg-to-write
2041-
//write print-rec
2042-
}
2043-
while(counter != 10);
2037+
int counter = 0;
2038+
do {
2039+
counter++;
2040+
System.out.println("The number is: " + counter);
2041+
} while (counter != 10);
20442042
```
20452043
*Example 16. Java while loop*
20462044

@@ -2069,9 +2067,9 @@ PERFORM 1000-PARAGRAPH-A
20692067
This may seem complex, but compare it to this Java pseudo-code:
20702068

20712069
```JAVA
2072-
for(int counter = 0; counter < 11; counter++){
2073-
for(int counter2 = 0; counter2 < 5; counter2++){
2074-
paragraphA();
2070+
for (int counter = 1; counter < 11; counter++) {
2071+
for (int counter2 = 1; counter2 < 5; counter2++) {
2072+
paragraphA();
20752073
}
20762074
}
20772075
```

0 commit comments

Comments
 (0)