Skip to content
Marlbridge

AP® Computer Science A · Unit 2 · Topic 2.8

for Loops: Topic Checklist (Computer Science A 2.8)

Specific I can statements for for loops, the header's three parts and equivalent while loops, each linked to the guide section or practice question that tests it.

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.

AP® and Advanced Placement® are trademarks registered by the College Board, which is not affiliated with, and does not endorse, this website. Marlbridge is an independent tuition provider. It is not an authorized AP course provider, an AP school or an exam centre, and these resources are not official College Board materials. Reading them or doing simulations does not meet the laboratory requirement of an AP science course.