Accumulator pattern: Using a variable initialized before the loop that accumulates a result (sum, count, or string) during each iteration.
How to apply it: Initialize the accumulator before the loop and update it inside the loop body.
Course: AP Computer Science A · Unit: Iteration
Practice questions about Accumulator pattern on AimFive — get rubric-based feedback showing exactly which points you earned.
AP and Advanced Placement are trademarks of College Board. AimFive is not affiliated with or endorsed by College Board.