Please enable JavaScript to use CodeHS

AP Computer Science A (Nitro)

Lesson 4.1 Iteration

Description

In this lesson, students will learn how and when to use a while loop. Repetitive code can be avoided by using a while loop. While loops are used to repeat a set of statements until a condition is met. This lesson corresponds with AP Computer Science A topic 4.1.


Objective

Students will be able to:

  • Represent iterative processes using a while loop
  • Execute a return or break statement inside an iteration statement to halt the loop and exit the method or constructor
  • Develop an algorithm
  • Identify if an integer is or is not evenly divisible by another integer
  • Determine a minimum or maximum value
  • Compute a sum, average, or mode