@@ -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
20112010This 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
20352034This 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
20692067This 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