[npl] / trunk / NationalProblemLibrary / Rochester / setAlgebra28ExpFunctions / beth1.pg Repository:
ViewVC logotype

View of /trunk/NationalProblemLibrary/Rochester/setAlgebra28ExpFunctions/beth1.pg

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3115 - (download) (annotate)
Wed Oct 17 17:35:27 2012 UTC (7 months ago) by jj
File size: 2243 byte(s)
Took pairs of problems which were exact duplicates except for their tags,
merged tags, and made one point to the other.

    1 ## DESCRIPTION
    2 ## Algebra: Exponential and Logarithmic Functions
    3 ## ENDDESCRIPTION
    4 
    5 ## Tagged by cmd6a 4/4/06
    6 
    7 ## DBsubject('Algebra')
    8 ## DBchapter('Exponential and Logarithmic Functions')
    9 ## DBsection('The Natural Exponential Function')
   10 ## Date('6/3/2002')
   11 ## TitleText1('College Algebra')
   12 ## AuthorText1('Stewart, Redlin, Watson')
   13 ## EditionText1('3')
   14 ## Section1('6.2')
   15 ## Problem1('11')
   16 ## KEYWORDS('compound interest')
   17 
   18 #
   19 # First comes some stuff that appears at the beginning of every problem
   20 #
   21 
   22 DOCUMENT();        # This should be the first executable line in the problem.
   23 
   24 loadMacros(
   25 "PG.pl",
   26 "PGbasicmacros.pl",
   27 "PGchoicemacros.pl",
   28 "PGanswermacros.pl",
   29 "PGauxiliaryFunctions.pl",
   30 "PGgraphmacros.pl"
   31 );
   32 
   33 TEXT(beginproblem());
   34 
   35 #make compound period and n arrays
   36 @compounding = ("daily","weekly","monthly","quarterly","semi-annually");
   37 @compoundingn = (365, 52, 12, 4, 2);
   38 
   39 #pick a compounding period
   40 $a=random(0,4);
   41 
   42 #pick a starting amount
   43 $amount = random (50000,200000,10000);
   44 
   45 #pick an interest rate
   46 $rate = random(5,12,.5);
   47 
   48 #change rate to a decimal
   49 $r=$rate/100;
   50 
   51 #determine the answers
   52 $ans1 = $amount /((1 + ($r /$compoundingn[$a]))**($compoundingn[$a]*1));
   53 $ans10 = $amount /((1 + ($r /$compoundingn[$a]))**($compoundingn[$a]*10));
   54 $ans20 = $amount /((1 + ($r /$compoundingn[$a]))**($compoundingn[$a]*20));
   55 $ans30 = $amount /((1 + ($r /$compoundingn[$a]))**($compoundingn[$a]*30));
   56 $ans40 = $amount /((1 + ($r /$compoundingn[$a]))**($compoundingn[$a]*40));
   57 $ans50 = $amount /((1 + ($r /$compoundingn[$a]))**($compoundingn[$a]*50));
   58 
   59 BEGIN_TEXT
   60 Complete the table below giving the amount \(P\) that must be invested at interest rate $rate $PERCENT
   61 compounded $compounding[$a] to obtain a balance of \(A\) = $DOLLAR$amount in \(t\) years.
   62 
   63 $PAR
   64      $BCENTER
   65 \{begintable(2)\}
   66 \{ row("\(t\)","\(P\)") \}
   67 \{ row("1",ans_rule(20)) \}
   68 \{ row("10",ans_rule(20)) \}
   69 \{ row("20",ans_rule(20)) \}
   70 \{ row("30",ans_rule(20)) \}
   71 \{ row("40",ans_rule(20)) \}
   72 \{ row("50",ans_rule(20)) \}
   73 \{endtable()\}
   74 $ECENTER
   75 END_TEXT
   76 
   77 
   78 ANS(num_cmp($ans1));
   79 ANS(num_cmp($ans10));
   80 ANS(num_cmp($ans20));
   81 ANS(num_cmp($ans30));
   82 ANS(num_cmp($ans40));
   83 ANS(num_cmp($ans50));
   84 
   85 ENDDOCUMENT();        # This should be the last executable line in the problem.

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9