CSE 110 Midterm: Term Test 3 - Fall 2017

144 views13 pages

Document Summary

Initializing a 2d arrays using an initialization list. While loop: executes the statement while the condition is true. Usually the loop control variable is created right before the loop. Increments the loop control variable when the control variable is incremented in the code. For loop: essentially does the same thing as a while loop but the loop control variable is declared and initialized in the loops header along with the increment statement being up there. The loop control variable actually increments right before the loop is supposed to end. Parts of the for loop are separated by ; . Do loop: runs through the statement one whole time before it hands off the statement to repeating with the while loop at the bottom of the do loop. Methods: a sequence of instructions with a name. Parameter variables: variables that are passed in to the method through the methods arguments or through (these parenthesis)