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

Annotation of /trunk/NationalProblemLibrary/Rochester/setAlgebra16FunctionGraphs/c0s1p1/c0s1p1.pg

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3115 - (view) (download)

1 : jjholt 156 ## DESCRIPTION
2 :     ## Algebra
3 :     ## ENDDESCRIPTION
4 : jj 146
5 : jjholt 156 ## Tagged by tda2d
6 :    
7 :     ## DBsubject('Algebra')
8 :     ## DBchapter('Functions')
9 :     ## DBsection('Graphs of Functions')
10 : jj 3115 ## Date('6/3/2002')
11 :     ## TitleText1('College Algebra')
12 :     ## AuthorText1('Stewart, Redlin, Watson')
13 :     ## EditionText1('3')
14 :     ## Section1('4.2')
15 :     ## Problem1('19 20 21 22')
16 :     ## KEYWORDS('function' 'graph' 'domain' 'range','function', 'graph', 'linear', 'increasing/decreasing')
17 : jjholt 156
18 :    
19 : jj 146 DOCUMENT(); # This should be the first executable line in the problem.
20 :    
21 :     loadMacros("PG.pl",
22 :     "PGbasicmacros.pl",
23 :     "PGchoicemacros.pl",
24 :     "PGanswermacros.pl",
25 :     "PGauxiliaryFunctions.pl");
26 :    
27 :     $pictSet=&random(1,3,1); #there are three sets of graphs
28 :    
29 :     $pictNum=&random(1,4,1); #each set has 4 graphs the numbers are below
30 :    
31 :     @pictID = (
32 :     "1-55141.gif",
33 :     "1-79226.gif",
34 :     "1-75352.gif",
35 :     "1-65474.gif",
36 :     "2-96187.gif",
37 :     "2-11287.gif",
38 :     "2-68382.gif",
39 :     "2-63428.gif",
40 :     "3-44144.gif",
41 :     "3-69221.gif",
42 :     "3-18387.gif",
43 :     "3-55459.gif"
44 :     );
45 :    
46 :     sub pictIndex{ # this gives offsets into @pictID -- I was too laxy to do multidimensional arrays
47 :     my ($i,$j)=@_;
48 :     return(($i-1)*4+$j-1 )
49 :     }
50 :    
51 :     @question = ();
52 :     @answer =();
53 :    
54 :     TEXT(beginproblem(),
55 :     qq!The simplest functions are the linear (or affine) functions ---
56 :     the functions whose graphs are
57 :     a straight line. They are important because many functions (the so-called
58 :     differentiable functions) ${LQ}locally$RQ look like straight lines.
59 :     (${LQ}locally$RQ means that
60 :     if we zoom in and look at the function at very powerful magnification
61 :     it will look like a straight line.) $PAR
62 :     !,
63 :     "Enter the letter of the graph of the function which corresponds to
64 :     each statement. $BR"
65 :     );
66 :    
67 :     qa(~~@question,~~@answer,
68 :     "The graph of the line is increasing",
69 :     @pictID[&pictIndex($pictSet,1)],
70 :     "The graph of the line is decreasing",
71 :     @pictID[&pictIndex($pictSet,2)],
72 :     "The graph of the line is constant",
73 :     @pictID[&pictIndex($pictSet,3)],
74 :     "The graph of the line is not the graph of a function",
75 :     @pictID[&pictIndex($pictSet,4)],
76 :     );
77 :    
78 :     @slice = 0..3; # select an ordered subset of the questions and answers
79 :     @shuffle = &shuffle(scalar(@slice)); # create a permutation of the right length
80 :     @images = @answer[@slice[@shuffle]]; # create a permuted list of the answers
81 :     @captions =@ALPHABET[0..3]; # the caption letters are always in order
82 :    
83 :     TEXT(
84 :     &match_questions_list(@question[@slice]),
85 :     &imageRow(~~@images,~~@captions)
86 :     );
87 :     @ans = @ALPHABET[&invert(@shuffle ) ];
88 :     ANS(str_cmp( [ @ans ] ) );
89 :    
90 :     ENDDOCUMENT(); # This should be the last executable line in the problem.

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9