In this lesson, students learn about the conditional statement “if”. Code within an “if statement” will only execute IF the condition is true.
if (frontIsClear()) {
// Code to be executed only if front is clear
}
Students will be able to:
In this lesson, students learn about an additional control structure, if/else statements. If/else statements let students do one thing if a condition is true, and something else otherwise.
if/else statements are written like this:
if (frontIsClear()) {
// code to execute if front is clear
} else {
// code to execute otherwise
}
Students will be able to:
In this lesson, students learn more about debugging strategies and get extra practice using if / else statements.
Students will be able to: