4.4

Nested Loops

AP Computer Science A

How nested loops work

Execution order

Counting total iterations

Classic patterns

Multiplication table

Right triangle of stars

Rectangle of numbers

Dependent inner loops

Nested loops with Strings

Find all pairs of characters

Check for duplicate characters

Trace practice

while loops nested in for loops (and vice versa)

AP Exam Tips

Common Mistakes

Key Vocabulary