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.
Students will be able to:
In this lesson. students learn how to use for loops in their programs. The for loop allows students to repeat a specific part of code a fixed number of times.
For loops are written like this:
for(int i = 0; i < 4; i++)
{
// Code to be repeated 4 times
}
This lesson corresponds with AP Computer Science A topic 4.2.
Students will be able to:
In this lesson, students will learn how to develop algorithms using Strings. Students will traverse Strings using a for loop and the print.length()
command.
for(int i = 0; i < string.length(); i++)
{
String character = string.substring(i, i+1);
}
This lesson corresponds with AP Computer Science A topic 4.3.
Students will be able to:
In this lesson, students will learn about nested loops. Nested loops are when loops are placed inside other loops to create more complex programs. When a loop is nested inside another loop, the inner loop must complete all its iterations before the outer loop can continue. This lesson corresponds with AP Computer Science A topic 4.4.
Students will be able to:
This lesson builds toward the following Enduring Understandings (EUs) and Learning Objectives (LOs). Students should understand that…
In this lesson, students will examine the concept of informal code analysis. This includes an algorithm’s correctness, efficiency and the ability to be understood. This lesson corresponds with AP Computer Science A topic 4.5.
Students will be able to: