AP®︎ Computer Science A Unit 2: Notes & Study Guide
Prepare for your quiz, test, or the AP exam with a comprehensive review on Unit 2 of AP Computer Science A – Selection and Iteration.
Unit 2: Selection and Iteration
This unit focuses on building algorithms using conditional statements and loops to control program flow and repeat operations.
Begin with Topic 2.1: Algorithms with Selection...To review Unit 2, go through each of the 12 topics below.
Everything you actually need to know for your Unit 2 test, pulled directly from the AP® Computer Science A curriculum.
Algorithms with Selection and Repetition
Algorithms with Selection and Repetition
- The Three Building Blocks of Algorithms
- How Selection Works in Algorithms
- How Repetition Works in Algorithms
Boolean Expressions
Boolean Expressions
- What Boolean Expressions Are
- Relational Operators
- How Boolean Expressions Evaluate
if Statements
if Statements
- How If Statements Control Program Flow
- Types of Selection Statements
- How Conditions Are Evaluated
Nested if Statements
Nested if Statements
- What Nested If Statements Are
- Multiway Selection with if-else-if
- How Nested Branching Executes
Compound Boolean Expressions
Compound Boolean Expressions
- What Compound Boolean Expressions Are
- Logical Operators and How They Work
- Operator Precedence and Grouping
Comparing Boolean Expressions
Comparing Boolean Expressions
- What It Means for Boolean Expressions to Be Equivalent
- De Morgan’s Laws
- Comparing Object References with Boolean Expressions
while Loops
while Loops
- What a While Loop Is
- The Loop Control Variable Pattern
- When You Use a While Loop
Implementing Selection and Iteration Algorithms
Implementing Selection and Iteration Algorithms
- What Standard Selection and Iteration Algorithms Are
- The Five Core Algorithm Patterns
- Writing and Applying These on the Exam
Implementing String Algorithms
Implementing String Algorithms
- What String Algorithms Are
- Character by Character Processing
- Substring Processing and Pattern Counting
Nested Iteration
Nested Iteration
- What Nested Iteration Is
- How Nested Loops Execute and How to Trace Them
- Common Patterns You Must Recognize
Informal Run-Time Analysis
Informal Run-Time Analysis
- What Informal Run-Time Analysis Is
- Recognizing Common Growth Patterns
- Counting Executions Step by Step
Notes
1 credit used · 5/5 remaining