[npl] / branches / UWSP / SS4e_01_01_015.pg Repository: Repository Listing bbplugincoursesdistsnplrochestersystemwww

# View of /branches/UWSP/SS4e_01_01_015.pg

Mon Oct 31 22:39:21 2011 UTC (19 months, 2 weeks ago) by nwodarz
File size: 4460 byte(s)
`Submitting Precalculus Section 1.1`

```    1 ##DESCRIPTION
2 ##   Identifying coordinates of points
3 ##ENDDESCRIPTION
4
6
7 ## DBsubject('Algebra')
8 ## DBchapter('Coordinates and Graphs')
9 ## DBsection('The Coordinate Plane')
10 ## Author('Nathan Wodarz')
11 ## Institution('UWSP')
12 ## TitleText1('Precalculus Enhanced with Graphing Utilities')
13 ## EditionText1('4')
14 ## AuthorText1('Sullivan, Sullivan')
15 ## Section1('1.1')
16 ## Problem1('15')
17 #
18 # First comes some stuff that appears at the beginning of every problem
19 #
20
21 DOCUMENT();        # This should be the first executable line in the problem.
22
24 # Always call these
25 "PGstandard.pl",
26 "MathObjects.pl",
27 "PGcourse.pl",
28 "PGunion.pl",
29 # Extra calls for this problem
30 "PGgraphmacros.pl",
31 "PGchoicemacros.pl",
33 );
34
35
36 TEXT(&beginproblem);
37 BEGIN_PROBLEM();
38 \$refreshCachedImages = 1;
39
40 Context("Numeric");
41
42 # Choose points to show
43
44 (\$x1, \$x2, \$x3) = NchooseK(10,3);
45 (\$y1, \$y2, \$y3) = NchooseK(10,3);
46
47 \$x1 = \$x1 - 5 + int((\$x1)/5);
48 \$x2 = \$x2 - 5 + int((\$x2)/5);
49 \$x3 = \$x3 - 5 + int((\$x3)/5);
50
51 \$y1 = \$y1 - 5 + int((\$y1)/5);
52 \$y2 = \$y2 - 5 + int((\$y2)/5);
53 \$y3 = \$y3 - 5 + int((\$y3)/5);
54
55 if ((\$x1 > 0) && (\$y1 > 0)) {
57 } elsif ((\$x1 < 0) && (\$y1 > 0)) {
59 } elsif ((\$x1 < 0) && (\$y1 < 0)) {
61 } elsif ((\$x1 > 0) && (\$y1 < 0)) {
63 }
64
65 if ((\$x2 > 0) && (\$y2 > 0)) {
67 } elsif ((\$x2 < 0) && (\$y2 > 0)) {
69 } elsif ((\$x2 < 0) && (\$y2 < 0)) {
71 } elsif ((\$x2 > 0) && (\$y2 < 0)) {
73 }
74
75 if ((\$x3 > 0) && (\$y3 > 0)) {
77 } elsif ((\$x3 < 0) && (\$y3 > 0)) {
79 } elsif ((\$x3 < 0) && (\$y3 < 0)) {
81 } elsif ((\$x3 > 0) && (\$y3 < 0)) {
83 }
84
89 );
90
95 );
96
101 );
102
103 # Graph the points
104
105 \$dom = 6;
106 \$grids =12;
107 \$graph = init_graph(-\$dom,-\$dom,\$dom,\$dom,grid =>[\$grids,\$grids], axes => [0,0]);
108 \$graph ->stamps( closed_circle(\$x1, \$y1, 'blue') );
109 \$graph ->stamps( closed_circle(\$x2, \$y2, 'red') );
110 \$graph ->stamps( closed_circle(\$x3, \$y3, 'black') );
111
112 \$label_f1 = new Label (\$x1+.2,\$y1,'P','blue','left');
113 \$label_f2 = new Label (\$x2+.2,\$y2,'Q','red','left');
114 \$label_f3 = new Label (\$x3+.2,\$y3,'R','black','left');
115
116 \$graph->lb(\$label_f1,\$label_f2,\$label_f3);
117
118 \$graph->gifName(\$graph->gifName()."-\$newProblemSeed");
119
120 Context()->texStrings;
121 BEGIN_TEXT
122 Determine the coordinates of the points shown. Assume the coordinates are integers. Give your answers as ordered pairs. The point \(P\) is depicted in blue, the point \(Q\) is in red and the point \(R\) is in black.\$PAR
123 \{ image(insertGraph(\$graph),height=>400,width=>400) \}
124 \$PAR
125 The coordinates of point \(P\) are \((x,y) = \) \{ans_rule(6)\}\$PAR
126 What quadrant is the point \(P\) in?\$BR
128 \$PAR
129 The coordinates of point \(Q\) are \((x,y) = \) \{ans_rule(6)\}\$PAR
130 What quadrant is the point \(Q\) in?\$BR
132 \$PAR
133 The coordinates of point \(R\) are \((x,y) = \) \{ans_rule(6)\}\$PAR
134 What quadrant is the point \(R\) in?\$BR
136 END_TEXT
137 Context()->normalStrings;
138
139 ## Do NOT show partial correct answers
142
143 Context("Point");
144 ANS(Compute("(\$x1,\$y1)")->cmp);