AP Computer Science A · Lesson 2.13 · Unit 2 · CED topic 2.11

Nested iteration

Name:   Date:  

1 Why this lesson matters

Read the opening paragraph and the "Required content" box on the lesson page. In your own words, explain each objective below.

11.A. Develop code to represent nested iterative processes and determine the result of these processes.

2 Loops inside loops

Read this section. In your own words, summarize the main idea.

3 When the inner loop depends on the outer one

Read this section. In your own words, summarize the main idea.

4 Using nested loops to compare every pair

Read this section. In your own words, summarize the main idea.

5 A common mistake: reusing the loop variable

Read this section. In your own words, summarize the main idea.

6 Worked example

Read the "Worked example" box. Then, without looking back, try writing your own answer below.

Print the products from 1 by 1 up to 3 by 3.

7 Exam focus: avoid this mistake

Read the "Exam focus" box, then restate it in your own words.

8 Sum it up

In two or three sentences, explain this lesson's main idea to someone who has not read it.