Skip to content
Marlbridge

AP® Computer Science A · Unit 2 · Topic 2.7

while Loops: Topic Checklist (Computer Science A 2.7)

Specific I can statements for while loops, their condition, and how to trace them, 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 explain when the condition of a while loop is tested and why the body might run zero times. (Guide: “Repeating while a condition holds” and “Zero iterations”; Practice question 3)
  • I can say what an infinite loop is and what usually causes it. (Guide: “Infinite loops”; Practice question 8)
  • I can say what an off-by-one error is and how a boundary choice causes it. (Guide: “Off-by-one errors”; Practice questions 5 and 8)
  • I can explain why the loop variable ends up one step past the last value processed. (Guide: “A first loop”; Practice question 2)

Skills

  • I can write a while loop with a correct initial value, condition and update. (Guide: “A first loop”; Practice question 7)
  • I can trace a while loop in a table and state its output. (Guide: “Tracing a loop”; Practice questions 2 and 6)
  • I can count how many times the body runs and how many times the condition is tested. (Guide: “Tracing a loop”; Practice questions 1 and 9)
  • I can accumulate a total, a count or a product in a loop. (Guide: “Accumulating a result” and Worked example 1; Practice question 7)

Reasoning

  • I can find and fix a loop that is infinite, off by one or never entered. (Guide: Worked example 2; Practice question 8)
  • I can say what initial conditions a loop needs for it to work as intended. (Guide: Worked example 2; Practice question 10)
  • I can choose between < and <= by checking the first and last values. (Guide: “Off-by-one errors”; Practice question 10)

All ticked? Move on to the Topic 2.8 study guide, for Loops.

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.