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 state what happens to the inner loop each time the outer loop runs once. (Guide: “A loop inside a loop”; Practice question 1)
- I can explain why
printlnplaced after the inner loop ends each row. (Guide: “Rows and columns”; Practice questions 2 and 7) - I can explain why an inner
whileloop variable must be set again on each outer pass. (Guide: “The inner variable must start again”; Practice questions 4 and 9) - I can explain how the inner bound depending on the outer variable changes the count. (Guide: “When the inner bound depends on the outer variable”; Practice question 3)
Skills
- I can trace nested loops and predict printed patterns. (Guide: “Rows and columns”; Practice questions 2 and 6)
- I can count how many times the innermost statement runs for rectangular and triangular bounds. (Guide: Worked example 1; Practice questions 1, 3 and 5)
- I can write nested loops that print a rectangle or a staircase. (Guide: “Rows and columns”; Practice question 7)
- I can write nested loops that test every pair of values. (Guide: Worked example 2; Practice question 8)
Reasoning
- I can find and fix a nested loop whose inner variable is not reset. (Guide: “The inner variable must start again”; Practice question 9)
- I can compare how the work grows for nested loops with different bounds. (Guide: Worked example 1; Practice question 10)
- I can choose
j = iorj = i + 1as the inner start to include or exclude equal pairs. (Guide: Worked example 2; Practice question 8)
All ticked? Move on to the Topic 2.12 study guide, Informal Run-Time Analysis.