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

RULE: The third if statement in this program will ONLY run if the random choice is 2. When we want an if statement to run in any condition, it must NOT be indented!

  • Click Run 4-5 times until choice is equal to 3 and watch the stage to see what's wrong.
  • Debug this program so that when 3 is selected, the shark appears.


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)