Please enable JavaScript to use CodeHS

AP Computer Science A (Cortado)

Selection and Iteration

Students learn how to control the flow of a program using conditional statements and loops. They develop Boolean expressions, use relational and logical operators, and write selection statements with if, if-else, and if-else-if. Students also explore iteration through while and for loops, including nested and compound iterations.

Lessons

2.1 Algorithms with Selection and Repetition

  • Algorithms with Selection and Repetition
  • Morning Jog Algorithm
  • Algorithms with Selection and Repetition
  • Everyday Algorithms (Part 1)
  • Everyday Algorithms (Part 2)
  • +2 more

2.2 Boolean Expressions

  • Boolean Expressions
  • Boolean Predictions
  • Debugging: Boolean Expressions
  • Boolean Expressions
  • Boolean Truth Tables
  • +4 more

2.3 if Statements

  • If Statements
  • Temperature Checks
  • Debugging: If Statements
  • Exploration: Running Speed
  • If Statements
  • +3 more

2.4 Nested if Statements

  • if-else-if Statements
  • Positive, Negative, or Zero
  • if-else-if Statements
  • Exploration: Salmon Spawn
  • Smoothie Order
  • +6 more

2.5 Compound Boolean Expressions

  • Compound Boolean Expressions
  • Bank Eligibility
  • Debugging: Booleans
  • Exploration: City Bus Discounts
  • Converting Pseudocode
  • +3 more

2.6 Comparing Boolean Expressions

  • Equivalent Boolean Expressions
  • De Morgan's Example
  • Amusement Park
  • Equivalent Boolean Expressions
  • Simplifying Boolean Expressions
  • +6 more

2.7 while Loops

  • While Loops
  • While Loop Countdown
  • Exploration: Lighting
  • While Loops
  • Making Taffy
  • +5 more

2.8 for Loops

  • For Loops (Part 1)
  • For Loops (Part 2)
  • Two Loops
  • Exploration: For Loop Variations
  • Print the Odds
  • +4 more

2.9 Implementing Selection and Iteration Algorithms

  • Implementing Selection and Iteration Algorithms
  • Running Average
  • Exploration: Factors
  • Exploration: The Leftovers
  • Max and Min Values
  • +3 more

2.10 Implementing String Algorithms

  • Implementing String Algorithms
  • Traversing Strings
  • Mystery String Algorithms Introduction
  • Exploration: Mystery Algorithm 1
  • Exploration: Mystery Algorithm 2
  • +6 more

2.11 Nested Iteration

  • Nested Iteration (Part 1)
  • Nested Iteration (Part 2)
  • Multiplication Table
  • Exploration: Make a Rectangle
  • Exploration: Inverted Triangle
  • +4 more

2.12 Informal Run-Time Analysis

  • Informal Run-Time Analysis
  • Evaluating Algorithms with Statement Execution Counts
  • Evaluating Algorithms with Statement Execution Counts Submission
  • Exploration: Statement Execution Count
  • Informal Run-Time Analysis
  • +2 more

2.13 Mid-Unit Assessment

  • Selection and Iteration -- Mid-Unit MCQ
  • Selection and Iteration -- Mid-Unit FRQ

2.14 End of Unit Assessment

  • Selection and Iteration -- Unit MCQ
  • Selection and Iteration -- Unit FRQ #1
  • Selection and Iteration -- Unit FRQ #2

Courses that include this module