Do this review in ONENOTE.
In each of the while loops and for loops below, Color the initialization red, underline the condition/test , color the change or increment blue in each loop
int x = 10; while ( x < 100 ) { } |
int sum = 0 ; |
for ( int x = 1; x < 6 ; x ++){ System.out.print(x); } |
for ( int z = 10; z >-1 ; z--){ System.out.print(z); }
|
Fill in the table of values for each equation based on the value of j
j |
j/10 |
j % 10 |
(j + 1.0)/10 |
j / 10.0 |
2 |
|
|
|
|
4 |
|
|
|
|
10 |
|
|
|
|
Write the output of this loop
for ( int j = 0; j < 9; j++ ) {
k = j + 2;
System.out.print( j + " " + k + " " );
System.out.println( );
}
What are the values of the variable as it goes through the loop while the condition is true, then what is it after the loop is over?
|
Starting value |
last time |
after loop |
for (x=1; x<=4; x++) |
|
|
|
for (y=10; y>=5; y--) |
|
|
|
for (k=10; k<=15; k+=2) |
|
|
|
for ( j = 0; j < 4; j++ ) |
|
|
|