LECTURE OCTOBER 15 2004 ASSIGNMENTS Today 11:58 PM CodeLab #6 Mon 10/18 Assignment 2 Fri 10/23 CodeLab #7 FOR STATEMENT Why? - count-controlled loops What? - syntax How? - for ( ; ; ) What? - control flow diagram How? - initialization rectangle points into - condition diamond - on true, points into statement rectangle - points into increment rectangle - points into condition - on false, points to subsequent statement What? - *control variable* How? - can be declared in - scope is limited to loop body - usually appears in all three parts What? - multiple statements in , , and How? - comma separate statements - strongly disrecommended EXPRESSIVE POWER What? - all three loop types equally expressive How? - choose the one that seems the most natural and direct NESTING What? - looping statements within looping statements How? - carefully RECURSION Why? - alternative to repetition What? - *recursive method* How? - method that calls itself