public void main ( ) {
Number rowLim = 3 ; Number colLim = 5 ; String rowData = ; Number product = 0 ; |
| |
// Copyright 2007, R.G.Baldwin |
| // Illustrates nested for loops. |
| for (int index=0; index< rowLim times ; index++) { |
| |
for (int index=0; index< colLim times ; index++) { |
| |
// Compute product of row and column. |
| product .set( value , ( ( index * index_#2 ) ) ); |
| // Append product onto print line. |
| rowData .set( value , ( rowData + ( product .toString() ) ) ); |
| // Append column separator (space character) to print line. |
| rowData .set( value , ( rowData + ) ); |
| // Perform another test in the inner loop. |
| } |
| // Display the row data. |
| print( rowData ); |
| // Clear the row data. |
| rowData .set( value , ); |
| // Perform another test in the outer loop. |
| } |
| } |