## DBsubject('Arithmetic') ## DBchapter('Integers') ## DBsection('Addition/subtraction') ## Level(2) ## KEYWORDS('arithmetic', 'adding') ## Author('Davor Cubranic') ## Institution('University of British Columbia') DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", ); ### Problem setup Context("Numeric"); $a = random(2, 9, 1); $a_plus_1 = Real("$a + 1"); ### Displayed text TEXT(beginproblem()); Context()->texStrings; BEGIN_TEXT What number is one greater than \( $a \)? $PAR \( $a + 1 = \) \{ ans_rule(35) \} END_TEXT Context()->normalStrings; ### Answer and solution ANS($a_plus_1->cmp()); Context()->texStrings; BEGIN_SOLUTION Because \( $a + 1 = $a_plus_1 \), the correct answer is \( $a_plus_1 \). END_SOLUTION Context()->normalStrings; ENDDOCUMENT();