##DESCRIPTION ## DBsubject('Algebra') ## DBchapter('Functions') ## DBsection('Modeling with Functions') ## KEYWORDS('word problem','revenue') ## Author('N.Spencer Sitton') ## Institution('NAU') ##ENDDESCRIPTION # File Created: 06/20/05 # Location: Northern Arizona University # Course:Quantitative Reasoning DOCUMENT(); loadMacros("PGstandard.pl" ); TEXT(&beginproblem); do{\$total1 = random( 800, 1600, 100); \$total2 = random( 800, 1600, 100); } until( \$total1 > \$total2); do{\$price1 = random( 2.05, 2.95, .05); \$price2 = random( 2.05, 2.95, .05); \$newprice = random( 2.05, 2.95, .05); } until( \$price1 > \$newprice && \$newprice > \$price2 ); do{\$total3 = random( 800, 1600, 100); } until( \$total1 != \$total3 || \$total2 != \$total3 ); \$slope = ( \$price2 - \$price1 ) / ( \$total1 - \$total2 ); \$yint = \$price2 - ( \$slope * \$total1 ) ; \$ans1 = ( \$newprice - \$yint) / (\$slope); \$ans2 = \$slope * \$total3 + \$yint; \$rev1 = ( \$price2 ) * ( \$total1); \$rev2 = ( \$price1 ) * ( \$total2); \$rev3 = ( \$newprice ) * ( \$ans1 ); \$rev4 = ( \$ans2 ) * ( \$total3 ); \$max = max( \$rev1, \$rev2, \$rev3, \$rev4 ); if( \$max == \$rev1 ){ \$ans3 = \$price2 } elsif( \$max == \$rev2 ){ \$ans3 = \$price1 } elsif( \$max == \$rev3 ){ \$ans3 = \$newprice } elsif( \$max == \$rev4 ){ \$ans3 = \$ans2 } \$cval = (-\$yint)/(2*\$slope); \$ans4 = ( \$slope * \$cval ) + \$yint; TEXT( qq! A gas station sells \$total1 gallons of gasoline per hour if it charges \$DOLLAR !,sprintf( "%1.2f", \$price2 ), qq! per gallon but only \$total2 gallons per hour if it charges \$DOLLAR !,sprintf( "%1.2f", \$price1 ), qq! per gallon. Assuming a linear model \$PAR (a) How many gallons would be sold per hour of the price is \$DOLLAR !,sprintf( "%1.2f", \$newprice ), qq! per gallon?\$BR Answer:!, ans_rule(10), qq! \$PAR (b) What must the gasoline price be in order to sell \$total3 gallons per hour? \$BR Answer: \$DOLLAR !, ans_rule(10), qq! \$PAR (c) Compute the revenue taken at the four prices mentioned in this problem -- \$DOLLAR !,sprintf( "%6.2f", \$price2 ),qq!, \$DOLLAR !,sprintf( "%6.2f", \$newprice ), qq!, \$DOLLAR !,sprintf( "%6.2f", \$price1 ), qq! and your answer to part (b). Which price gives the most revenue? \$BR Answer: \$DOLLAR !, ans_rule(10) ,qq! \$PAR (d) What is the price that the gas station should charge to maximize revenue? \$BR Answer: \$DOLLAR !,ans_rule(10) ,qq! !, ); ANS( num_cmp( \$ans1 ) ); ANS( num_cmp( \$ans2 ) ); ANS( num_cmp( \$ans3 ) ); ANS( num_cmp( \$ans4 ) ); ENDDOCUMENT();