########################################################## # # 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('Complex'); $z = random(-5,5,1) + non_zero_random(-5,5,1)*i; $f = Formula('z^2 + 2z - 1'); $fz = $f->eval(z => $z); ########################################################## # # The problem text # Context()->texStrings; BEGIN_TEXT Suppose \(f(z) = $f\).$BR Then \(f($z)\) = \{ans_rule(20)\}. END_TEXT Context()->normalStrings; ########################################################### # # The answer # ANS($fz->cmp); ########################################################### ENDDOCUMENT(); # This should be the last executable line in the problem.