We look at our third story problem.
|
The price of a car has been reduced from $12,345.21 to $10,678.32. What is the percent of discount?” |
This is a typical problem where we – as teachers of mathematics – know what kind of answer we want, i.e. a positive valued percent. However, sometimes when creating a question, we forget how literal computers are – so we must make sure that our variables are correctly assigned. In the Troubleshooting section of this chapter, we will discuss what happens and what to do if we make a mistake like this.
We want to use variables from our previous questions. So let’s think about which of these variables we need to substitute for the number $12,345.21 and for the number $10,678.32.
Let S=$12,345.21 and a=$10,678.32. Then p is positive and is the correct answer.
Step 1: Duplicating.
Here we have a question that is both related to the previous question and to that of question 3. We choose to duplicate question 3.
A new question 4 will appear.
Step 2: Define a list variable.
As in the above two story problems, we define a list variable – this time for the item.
Define our first variable ItemList as below. (Of course, you can type in any 5 items in the same price range – with quotation marks around and a comma after each item.)

As in Part F, Step 2, we set up the mechanism for choosing an item from this list.

Continuing, we define the variable which actually chooses a item.

Step 3: Edit the existing algorithm definitions.
Since we duplicated question 3, we need to change the format as well as the range of the variables a, b and p and we need to define the variable S.
1. The variables a and b are numbers: #,###,### and have 2 fixed decimal places.
2. We define a in the range of $5000 to $15,000 with a step of 0.01 and
p in the range of 0.1% to 35% with a step of 0.1.
3. In these problems we are using the formula: S=a+b with the same formatting as for the variables a and b.
For our answer variables, we have:
4. AnsA= p. Here are our choices for the incorrect answers.
5. AnsB=S/a , AnsC=a*100/S , AnsD= p*1.05.
6. In these definitions, remember to round to 2 decimal places and to change the format
to 2 fixed decimal places and to be numbers: #,###,###.
♦ If you need help in recalling exactly how to do the above steps, see Part F, Step 3.

Here is our question:

Step 4: Save the file
|
|
Parking Place |