[npl] / trunk / NationalProblemLibrary / FortLewis / Algebra / 9-2-Quadratic-expressions / MCH1-9-2-05-Quadratic-expressions.pg Repository:
ViewVC logotype

Annotation of /trunk/NationalProblemLibrary/FortLewis/Algebra/9-2-Quadratic-expressions/MCH1-9-2-05-Quadratic-expressions.pg

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1605 - (view) (download)

1 : pearson 1271 ## DESCRIPTION
2 :     ## Quadratic functions, expressions, and equations
3 :     ## ENDDESCRIPTION
4 :    
5 :     ## KEYWORDS('quadratic functions')
6 :    
7 : pearson 1605 ## DBsubject('Algebra')
8 :     ## DBchapter('Quadratic Functions, Expressions, and Equations')
9 : pearson 1271 ## DBsection('Working with Quadratic Expressions')
10 :     ## Date('01/01/10')
11 :     ## Author('Paul Pearson')
12 :     ## Institution('Fort Lewis College')
13 : pearson 1605 ## TitleText1('Algebra Form and Function')
14 : pearson 1271 ## EditionText1('1')
15 :     ## AuthorText1('McCallum, Connally, and Hughes-Hallett')
16 :     ## Section1('9.2')
17 :     ## Problem1('5')
18 :    
19 :     ####################################
20 :     # Initialization
21 :    
22 :     DOCUMENT();
23 :     loadMacros(
24 :     "PGstandard.pl",
25 :     "MathObjects.pl",
26 :     "AnswerFormatHelp.pl",
27 :     "PGcourse.pl",
28 :     );
29 :    
30 :     TEXT(beginproblem());
31 :    
32 :    
33 :     ####################################
34 :     # Setup
35 :    
36 :     Context("Numeric");
37 :    
38 :     $h = non_zero_random(-2,2,1);
39 :     $k = non_zero_random(-5,5,1);
40 :     while ($h==$k) { $k = non_zero_random(-5,5,1); }
41 :     $yint = random(-1,1,2) * random(2,6,1);
42 : pearson 1605 while ($yint==$k) { $yint = random(-1,1,2) * random(2,6,1); }
43 : pearson 1271
44 :     $p = $yint - $k;
45 :     $q = $h * $h;
46 :    
47 :     while ($p == $q || $p == -$q) {
48 :    
49 :     $h = non_zero_random(-2,2,1);
50 :     $k = non_zero_random(-5,5,1);
51 :     while ($h==$k) { $k = non_zero_random(-5,5,1); }
52 :     $yint = random(-1,1,2) * random(2,6,1);
53 :    
54 :     $p = $yint - $k;
55 :     $q = $h * $h;
56 :    
57 :     }
58 :    
59 :     $answer = Formula("($p/$q) (x - $h)^2 + $k")->reduce;
60 :    
61 :    
62 :     ######################################
63 :     # Main text
64 :    
65 :     BEGIN_TEXT
66 :     Find a formula for the quadratic function
67 :     whose graph has vertex \( ($h,$k) \) and
68 :     y-intercept \( $yint \).
69 :     $BR
70 :     $BR
71 :     \( f(x) = \)
72 :     \{ ans_rule(30) \}
73 :     \{ AnswerFormatHelp("formulas") \}
74 :     END_TEXT
75 :    
76 :    
77 :     ######################################
78 :     # Answer evaluation
79 :    
80 :     $showPartialCorrectAnswers = 1;
81 :    
82 : pearson 1605 ANS( $answer->cmp() );
83 : pearson 1271
84 :     ENDDOCUMENT();

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9