Please enable JavaScript to use CodeHS

Intro to Programming with Karel the Dog (Ace)

Description

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
}
Objective

Students will be able to:

  • Use conditions to gather information about Karel’s world (is the front clear, is Karel facing north, etc)
  • Create if statements that only execute code if a certain condition is true
Description

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
}
Objective

Students will be able to:

  • Explain the purpose of an If/Else statement
  • Create If/Else statements to solve new types of problems
  • Identify when it is appropriate to use an If/Else statement
Description

In this lesson, students learn more about debugging strategies and get extra practice using if / else statements.

Objective

Students will be able to:

  • Use debugging strategies to find and fix errors in their code.
  • Identify different types of errors in their code.
  • Explain the meaning of different error messages.
  • Explain the purpose of an If/Else statement
  • Create If/Else statements to solve new types of problems