[npl] / trunk / NationalProblemLibrary / Rochester / setAlgebra16FunctionGraphs / sw4_2_1.pg Repository:
ViewVC logotype

View of /trunk/NationalProblemLibrary/Rochester/setAlgebra16FunctionGraphs/sw4_2_1.pg

Parent Directory Parent Directory | Revision Log Revision Log


Revision 145 - (download) (annotate)
Sun Mar 26 22:21:31 2006 UTC (7 years, 1 month ago) by jj
File size: 1759 byte(s)
Initial import

    1 ##DESCRIPTION
    2 ## Algebra: Graphs of functions
    3 ##ENDDESCRIPTION
    4 
    5 ##KEYWORDS('algebra', 'function', 'domain', 'range')
    6 
    7 DOCUMENT();        # This should be the first executable line in the problem.
    8 
    9 loadMacros(
   10 "PG.pl",
   11 "PGbasicmacros.pl",
   12 "PGchoicemacros.pl",
   13 "PGanswermacros.pl",
   14 "PGauxiliaryFunctions.pl",
   15 "PGasu.pl",
   16 "extraAnswerEvaluators.pl"
   17 );
   18 
   19 TEXT(beginproblem());
   20 $showPartialCorrectAnswers = 0;
   21 
   22 
   23 TEXT(EV2(<<EOT));
   24 For the function \(h(x)\) given in the graph
   25 $PAR \{ image("c2s2p1.gif", width=>206, height=>178) \} $PAR
   26 $BR
   27 its domain is \{ans_rule(25)\};
   28 $BR
   29 its range is \{ans_rule(25)\};
   30 $BR
   31 Write the answer in interval notation.
   32 $BR
   33 and then
   34 enter the corresponding function value in each answer space below:
   35 $BR
   36 EOT
   37 
   38 $ans1=-3;
   39 $ans2=3;
   40 $ans3=-2;
   41 $ans4=2;
   42 ANS(interval_cmp("[$ans1,$ans2]"));
   43 ANS(interval_cmp("[$ans3,$ans4]"));
   44 
   45 ## First we set up our variables.
   46 
   47 $questStr1 = EV2(" \( h(-3) \)");
   48 $ansStr1 = 2;
   49 $questStr2 = EV2(" \( h(-2) \)");
   50 $ansStr2 = 1;
   51 $questStr3 = EV2(" \( h(-1) \)");
   52 $ansStr3 = -1;
   53 $questStr4 = EV2(" \( h(0) \)");
   54 $ansStr4 = -2;
   55 $questStr5 = EV2(" \( h(1) \)");
   56 $ansStr5 = 0;
   57 $questStr6 = EV2(" \( h(2) \)");
   58 $ansStr6 = 1;
   59 $questStr7 = EV2(" \( h(3) \)");
   60 $ansStr7 = -1;
   61 
   62 @questions =( $questStr1,$questStr2,$questStr3,$questStr4,$questStr5,
   63 $questStr6,$questStr7);
   64 @answers =( $ansStr1,$ansStr2,$ansStr3,$ansStr4,$ansStr5,$ansStr6,$ansStr7);
   65 
   66 ## Now choose radomly 4  questions out of the 7 questions strings above.
   67 
   68 @slice = NchooseK(scalar(@questions),4);
   69 
   70 ## Next we output the 4 chosen questions.
   71 TEXT(
   72 &match_questions_list(@questions[@slice])
   73 );
   74 
   75 ANS(str_cmp([@answers[@slice]], filters=>["remove_whitespace","ignore_case"]));
   76 
   77 ENDDOCUMENT();        # This should be the last executable line in the problem.
   78 

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9