[npl] / trunk / NationalProblemLibrary / maCalcDB / setAlgebra04ExpressionsFactoring / lhp4_51-54.pg Repository:
ViewVC logotype

View of /trunk/NationalProblemLibrary/maCalcDB/setAlgebra04ExpressionsFactoring/lhp4_51-54.pg

Parent Directory Parent Directory | Revision Log Revision Log


Revision 17 - (download) (annotate)
Wed Oct 19 17:03:53 2005 UTC (7 years, 7 months ago) by jj
File size: 1533 byte(s)
Added subject tag.

    1 ##DESCRIPTION
    2 ##  lhp4_51-54.pg.
    3 ##ENDDESCRIPTION
    4 
    5 ##KEYWORDS('algebra, factoring, perfect square trinomial')
    6 ## hcao tagged and PAID on 2-20-2004
    7 
    8 ## DBsubject('Algebra')
    9 ## DBchapter('Basic Algebra')
   10 ## DBsection('Algebraic Expressions')
   11 ## Date('6/3/2002')
   12 ## Author('Tangan Gao')
   13 ## Institution('csulb')
   14 ## TitleText1('College Algebra')
   15 ## EditionText1('3')
   16 ## AuthorText1('Stewart, Redlin, Watson')
   17 ## Section1('1.4')
   18 ## Problem1('46')
   19 
   20 DOCUMENT();
   21 loadMacros("PGbasicmacros.pl",
   22            "PGanswermacros.pl",
   23            "PGauxiliaryFunctions.pl",
   24 "parserMultiPart.pl"
   25 );
   26 
   27 TEXT(beginproblem());
   28 $showPartialCorrectAnswers = 1;
   29 
   30 
   31 $a=random(2,5,1);
   32 $b=random(2,7,1);
   33 $c=$a+3;
   34 $d=$b+2;
   35 $a1=$a*$c;
   36 $a2=$a*$d+$b*$c;
   37 $a3=$b*$d;
   38 
   39 $mp = MultiPart($a, $b, $c, $d)->with(
   40         singleResult => 1,
   41         checker => sub {
   42           my ($correct,$student,$self) = @_;  # get the parameters
   43           return 0 if (($student->[0]*$student->[2]) != ($correct->[0]*$correct->[2]));
   44           return 0 if (($student->[1]*$student->[3]) != ($correct->[1]*$correct->[3]));
   45           return 0 if ($student->[0]*$student->[3]+$student->[1]*$student->[2] !=
   46     $correct->[0]*$correct->[3]+$correct->[1]*$correct->[2]);
   47           return 1;
   48         },
   49     );
   50 
   51 
   52 
   53 BEGIN_TEXT
   54 
   55 
   56 Factor the trinomial \($a1 x^2 - $a2 x +$a3\):$BR$BR
   57 \[$a1 x^2 -$a2 x+ $a3=(Ax-B) (Cx-D) \]
   58 $BR
   59 \(A=\) \{ $mp->ans_rule(5)\}, \(B=\) \{$mp->ans_rule(5)\}, \(C=\) \{$mp->ans_rule(5)\}, and \(D=\) \{$mp->ans_rule(5)\}
   60 END_TEXT
   61 
   62 ANS( $mp->cmp);
   63 
   64 ENDDOCUMENT();

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9