AP Computer Science A · Lesson 2.9 · Unit 2 · CED topic 2.8

for loops

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.

8.A. Develop code to represent iterative processes using for loops and determine the result of these processes.

2 The three parts of a for loop

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

3 A for loop is a while loop in disguise

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

4 Counting the iterations

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

5 Worked example

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

Add the integers from 1 to 100, and count the even numbers from 1 to 20.

6 Exam focus: avoid this mistake

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

7 Sum it up

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