##DESCRIPTION ## Absolute Value Equalites and Inequalities ## ##ENDDESCRIPTION ## DBsubject(Algebra) ## DBchapter(Inequalities and problem solving) ## DBsection('Equations and Inequalities Involving Absolute Value') ## KEYWORDS('inequalities','absolute value') ## TitleText1('Essentials of Intermediate Algebra') ## EditionText1('1') ## AuthorText1('Blitzer') ## Section1('4.3 ## Problem1('') ## Author('RA Cruz') ## Institution('The College of Idaho') ## Date: 2007/10 DOCUMENT(); # This should be the first executable line in the problem. loadMacros( "PGstandard.pl", "MathObjects.pl", "contextInequalitiesAllowStrings.pl", ); TEXT(beginproblem()); ###################################### # Setup Context("Inequalities-AllowStrings"); Context()->constants->add(a => Real(exp(2)/cos(3)), b=> Real(3147.115)); Context()->flags->set(formatStudentAnswers=>"parsed"); Context()->strings->add(none=>{}); $c = random(-10,10,1); Context()->texStrings; ###################################### # Main text BEGIN_TEXT Solve for \(x\) in terms of \(a\) and \(b\) (you may assume \(a \gt 0\)): \( |a x + b| \le $c \) $PAR Answer: \{ ans_rule(20) \} $BR Note: END_TEXT ###################################### Context()->normalStrings; # Answer $ans = Compute("0"); if($c < 0 ) { $ans = Compute("none"); } if($c==0) { $ans = Compute("x=-b/a"); } if($c>0) { $ans = Compute("(-$c-b)/a<=x<=($c-b)/a"); } ANS($ans->cmp); $showPartialCorrectAnswers = 1; ###################################### COMMENT('MathObject version'); ENDDOCUMENT();