AP Computer Science A · Lesson 1.6 · Unit 1 · CED topic 1.6

Compound assignment operators

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.

6.A. Develop code for assignment statements with compound assignment operators and determine the value that is stored in the variable as a result.

2 The compound assignment operators

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

3 Increment and decrement

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

4 Two patterns every program uses

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.

Rewrite each statement without a compound operator, and give the value of n if it starts at 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.