ITM 200 Chapter 6: Chapter 6

61 views5 pages

Document Summary

6. 1 a problem: to write a method to output the statement i must practice my programming 100 times, pseudocode. while the counter is <= 100: print the important info, add 1 to the counter. In java, it would look like: public static void lines (strings [] args) { int counter; counter = 1; while (count <= 10) : system. out. println( i must practice my programming ); counter = counter + 1; } The while loop statement the details: syntax of the java while loop statement is as follows, while () If is true then is performed and is evaluated again and if it is still true then is performed again: this cycle of evaluating and performing continues until. Increment operator is +: decrement operator is - , example on pg 124, total += counter also means total = total + counter, example on pg 125.