## DESCRIPTION ## Algebra: an equation defining a function ## ENDDESCRIPTION ## KEYWORDS('algebra', 'equation defining a function') ## DBsubject('WeBWorK') ## DBchapter('WeBWorK Tutorial') ## DBsection('Fort Lewis Tutorial 2011') ## Date('01/30/2011') ## Author('Paul Pearson') ## Institution('Fort Lewis College') ## TitleText1('') ## EditionText1('') ## AuthorText1('') ## Section1('') ## Problem1('') ########################### # Initialization DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", "parserAssignment.pl", ); TEXT(beginproblem()); ########################## # Setup Context("Numeric")->variables->are(x=>"Real",y=>"Real"); parser::Assignment->Allow; parser::Assignment->Function("f"); \$eqn = Formula("y=5x+2"); \$fun = Formula("f(x)=3x^2+2x"); ################################# # Main text Context()->texStrings; BEGIN_TEXT Enter \( y = 5x+2 \) \{ ans_rule(20) \} \$BR \$BR Enter \( f(x) = 3x^2+2x \) \{ ans_rule(20) \} END_TEXT Context()->normalStrings; ################################# # Answer evaluation \$showPartialCorrectAnswers = 1; ANS( \$eqn->cmp() ); ANS( \$fun->cmp() ); ################################# # Solution Context()->texStrings; BEGIN_SOLUTION \${PAR}SOLUTION:\${PAR} Solution explanation goes here. END_SOLUTION Context()->normalStrings; COMMENT('MathObject version.'); ENDDOCUMENT();