[npl] / trunk / NationalProblemLibrary / ASU-topics / set119LPGraphical / p8.pg Repository: Repository Listing bbplugincoursesdistsnplrochestersystemwww

# View of /trunk/NationalProblemLibrary/ASU-topics/set119LPGraphical/p8.pg

Sat Jan 14 02:13:08 2006 UTC (7 years, 5 months ago) by jj
File size: 1191 byte(s)
```New problems for the library.
```

```    1 ##DESCRIPTION
2 ##   Evaluation of a simple algebraic expression
3 ##ENDDESCRIPTION
4
5 ##KEYWORDS('percent')
6
7 #
8 # First comes some stuff that appears at the beginning of every problem
9 #
10
11 DOCUMENT();        # This should be the first executable line in the problem.
12
14 "PG.pl",
15 "PGbasicmacros.pl",
16 "PGchoicemacros.pl",
18 "PGauxiliaryFunctions.pl",
19 "PGasu.pl"
20 );
21
22 TEXT(&beginproblem);
23
24 #
25 # Now we do the randomization of variables, and other computations
26 # as needed for this problem.  Sometimes we compute the answers here.
27 #
28
29 \$a = random(1,9);
30 \$b = random(-3,2);
31
32 \$ans1 = (\$a+\$b)/2;
33
34 #
35 # Now the problem text itself, with ans_rule's to indicate where the
36 # answers go.  You can stop entering text, do more computations, and then
37 # start up again if you want.
38 #
39
40 BEGIN_TEXT
41 What is the average of \$a and \$b?
42   \$PAR
43   Average = \{ans_rule(40)\}
44 END_TEXT
45
46 #
47 # Tell WeBWork how to test if answers are right.  These should come in the
48 # same order as the answer blanks above.  You tell WeBWork both the type of