STEP 4: Write your linear function rule.

  • In the LOGIC tab, click on . Drag Integer Variable into your program.
  • Change the variable name from my_var to x. Change the variable's value from 25 to -5.
  • Click on the category and drag out Loop with Range.
  • Click into the code editor and type your linear function rule INSIDE the loop, like this: ····y·=·2·*·x·+·1

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)