STEP 11: We're done, right? Our program does everything we'd want it to. Wrong! It still throws an error.

A runtime error is an error that occurs while a program is running, causing it to stop.

  • Click Run and enter something that's not a number for the first question.
  • Did you get an error? Our program is casting the string input into an integer. However, text isn't a number!
  • Click Run again and enter a number. When ready, click Submit and Next to move on.

    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)