PREVIEW: This is a program from a previous lesson, Math Machine.

If there's a pattern of identical commands with different values in a program, it's time to think about refactoring! Identical code can be placed in a function, and nonidentical values can be passed in as function arguments!

  • Click Run and watch the stage. Use the code in the editor to answer the questions.
  • Click Submit , then Next to continue.

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)