Work through the list without notes. If you cannot do a statement, follow its link, then come back. Guide = study guide; Practice = practice questions.
Understanding
- I can name the three parts of a for loop header and say when each one runs. (Guide: “The order of execution”; Practice question 3)
- I can explain why the update runs after the whole body and before the next test. (Guide: “The order of execution”; Practice question 3)
- I can explain why a variable declared in the header cannot be used after the loop. (Guide: “Scope of the loop control variable”; Practice question 6)
- I can explain what a semicolon after the header does. (Guide: “Errors to watch for”; Practice question 5)
Skills
- I can count the iterations of a for loop that steps up, down or by more than 1. (Guide: “Counting up, counting down, stepping”; Practice questions 1 and 7)
- I can trace a for loop with a table and give the output. (Guide: Worked example 1; Practice questions 2 and 8)
- I can rewrite a for loop as a while loop and a while loop as a for loop. (Guide: “A for loop is a while loop in disguise” and Worked example 2; Practice questions 4, 7 and 10)
- I can accumulate a sum or product in a for loop. (Guide: “Accumulating inside a for loop”; Practice question 2)
Reasoning
- I can find and fix off-by-one and wrong-direction errors in a header. (Guide: “Errors to watch for”; Practice question 9)
- I can explain how changing the loop variable inside the body changes the number of iterations. (Guide: “Errors to watch for”; Practice question 3)
- I can choose a loop form that suits the problem (counted or data-driven). (Guide: Worked example 2; Practice question 10)
All ticked? Move on to the Topic 2.9 study guide, Implementing Selection and Iteration Algorithms.