|
(Review) What three parts of a loop must be coordinated in order for the loop to work properly? A good answer might be:
|
Counting Upwards by Two'sIf you change one of these three parts, the loop will do something different. Here is a section of a Java program that counts upwards by two's:
Here is what the program will print
Here is what happens, step-by-tedious-step:count is: 0 count is: 2 count is: 4 count is: 6 Done counting by two's.
|
QUESTION 2:Let us make just one change to the program fragment: we will change the initialization of count to:
What does the program print out?
(This is a slightly tricky question. Please take time to work out the answer.)
Click Here after you have answered the question
|