ENGIN 7 Chapter 5: Iterations
Document Summary
5. 1 for loops for loop sequence of instructions that is repeated, or iterated, for every value of a looping array looping variable variable that holds current value of looping array also referred to as definite loops because they have a predefined begin and end syntax for looping variable = looping array code block end a for loop assigns the looping variable to the first element of the looping array, executes everything in the code block, then assigns looping variable to next element of looping array and executes code block again does this until no more elements in looping array to assign can be nested as well. 5. 2 indefinite loop while loop/indefinite loop set of instructions that is repeated as long as the associated logical expression is true syntax while logical expression code block end. Switch case expressions syntax: switch switch_expression case case_expression statements case case_expression statements otherwise statements end.