WARNING: This program has a bug, which means we need to fix it! This program has a logic error!

RULE: Remember, if we want an if statement to occur WITHIN a loop, we need to indent it.

  • Click Run and look at the stage to see what's wrong.
  • Indent the if statement so it happens inside the loop.
  • Debug the program so that toothbrush cleans ALL of the teeth.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)