STEP 3: Let's ask the user which math operation they'd like the sprite to perform!

  • Drag out Ask. Change the name of the input variable from choice to operation.
  • Change the string to "Do you want to a) add, b) subtract, c) multiply, or d) divide?"

The user will enter a letter, and we will call a specific function based on what the user entered! Click Next to start creating those functions!

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)