Example: equation of a function
function of first degree
In next applet one has to give the equation of the function. See how it works and make it yourself, following the Construction Steps.
Note that while working with functions sol and ans become sol(x) and ans(x).
Try it yourself...
Construction Steps
1 | | Type the command lista= Shuffle({-3, -2, -1, -0.5, 0.5, 1, 2, 3}) to create list a. |
2 | | Type the command a= lista(1) to create a number a. |
3 | | Type the command b= RandomBetween(-4, 4) to create a number b. |
4 | | Type the command sol(x): a x + b to define the function sol(x). |
5 | | Type the command ans(x)=undefined to define the function ans(x) |
6 | | Select the Text Tool and ceate the text The eqution of f is. |
7 | | Select the Input Box Tool and create an Input Box with label =, linked to the object empty. Rightclick in the Input Box to open its properties. Type the command SetValue[ans, %0] in the tab On Click of the tab scripting. See below for the Dynamic Colors of the Input Box. |
8 | | Select the Input Box Tool and create an Input Box with label f(x) =, linked to the object ans. Since ans is undefined the inputbox will show empty. See below for the Dynamic Colors of the Input Box. |
9 | | Select the Button Tool and create a button with label new exercise and scripting commands: UpdateConstruction() SetValue(ans, undefined) |