########################################################## # # Example showing how to use the built-in answer checker for parsed values. # DOCUMENT(); # This should be the first executable line in the problem. loadMacros( "PGbasicmacros.pl", "PGanswermacros.pl", "Parser.pl", ); TEXT(beginproblem()); ########################################################## # # The setup # Context('Numeric'); $a = Real(random(2,6,1)); $b = Real(random($a+1,$a+8,1)); $c = sqrt($a**2 + $b**2); # still a Real object ########################################################## # # The problem text # Context()->texStrings; BEGIN_TEXT Suppose the legs of a triangle are of length \($a\) and \($b\).$BR Then the hypoteneuse is of length \{ans_rule(20)\}. END_TEXT Context()->normalStrings(); ########################################################### # # The answer # ANS($c->cmp); ########################################################### ENDDOCUMENT(); # This should be the last executable line in the problem.