Advertisement
Guest User

addition-scaffold

a guest
Feb 27th, 2015
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.03 KB | None | 0 0
  1. ##DESCRIPTION
  2. ## PreAlgebra problem:
  3. ##ENDDESCRIPTION
  4.  
  5. ##KEYWORDS('prealgebra','common core')
  6.  
  7. ## DBsubject('Arithmetic')
  8. ## DBchapter('Integers')
  9. ## DBsection('Addition/subtraction')
  10. ## Date('2/26/2015')
  11. ## Author('Andrew Parker')
  12. ## Institution('NYC CityTech')
  13. ## ProblemTester('')
  14. ## TitleText1('')
  15. ## Publisher('')
  16. ## EditionText1('')
  17. ## AuthorText1('')
  18. ## Section1('')
  19. ## Problem1('')
  20.  
  21. ########################################################################
  22.  
  23. DOCUMENT();
  24.  
  25. loadMacros(
  26. "PGstandard.pl", # Standard macros for PG language
  27. "MathObjects.pl",
  28. "problemRandomize.pl",
  29. "parserPopUp.pl",
  30. "scaffold.pl"
  31. );
  32.  
  33. # Print problem number and point value (weight) for the problem
  34. TEXT(beginproblem());
  35.  
  36. # Allow for the user to try another version of the problem once they get it correct.
  37. ProblemRandomize(when=>"Correct",onlyAfterDue=>0);
  38.  
  39. # Show which answers are correct and which ones are incorrect
  40. $showPartialCorrectAnswers = 0;
  41.  
  42. ##############################################################
  43. #
  44. # Setup
  45. #
  46. #
  47.  
  48. ## Part 1: Car Payment ##
  49.  
  50. $debt = random(1,5,1)*5000;
  51. $cash = random(1,9,2)*250;
  52. $total = Real( -1*$debt + $cash );
  53.  
  54. $popup1 = PopUp(["?", "Positive", "Negative"], "Negative");
  55. $popup2 = PopUp(["?", "Positive", "Negative"], "Positive");
  56. $popup3 = PopUp(["?", "We owe more.", "We have more."], "We owe more.");
  57.  
  58. ## Part 2: Buying an apartment ##
  59.  
  60. $cost = random(3,9,1)*25000;
  61. $down = random(4,9,1)*5000;
  62. $loan = Real(-1*$cost + $down );
  63.  
  64. $popup4 = PopUp(["?", "Money left over.", "In debt."], "In debt.");
  65. $popup5 = PopUp(["?", "Positive", "Negative"], "Negative");
  66.  
  67. ## Part 3: Consolidating Debt ##
  68.  
  69. $debt1 = -1*$total;
  70. $debt2 = -1*$loan;
  71. $totaldebt = $total+$loan;
  72.  
  73. $popup6 = PopUp(["?", "Positive", "Negative"], "Negative");
  74.  
  75. ##############################################################
  76. #
  77. # Text
  78. #
  79. #
  80.  
  81. ## to disable arithmetic operations in the answer. Student must simplify.
  82. Context()->operators->undefine("+","-","*","/");
  83.  
  84. ##############################################################
  85. # Scaffolding
  86. Scaffold::Begin();
  87. ##############################################################
  88. Section::Begin("Part 1: Car payment");
  89.  
  90. Context()->texStrings;
  91. BEGIN_TEXT
  92.  
  93. Negative numbers are an essential part of mathematics, they show up as a necessary part of real life. Sometimes, we have to spend money that we don’t actually have – maybe we take out a loan from the bank to pay for a car or a house – and that puts us into debt. Debt is money that we owe as opposed to money that we have. When we owe money, we must take money that we earn and use it to make payments – which reduces our debt.
  94. $PAR
  95. For example, lets say we owe the bank $$debt, and we have $$cash that we’re going to use to make a payment on our debt.
  96.  
  97. $PAR
  98. $PAR
  99. (a) How would you represent our debt of $$debt? Should this number be positive or negative? \{ $popup1->menu() \}
  100. $BR
  101. (b) How would you represent our $$cash in cash? Should this number be positive or negative? \{ $popup2->menu() \}
  102. $BR
  103. (c) Do we have enough money to pay off the whole debt? Or do we owe more money than what we have? \{ $popup3->menu() \}
  104. $BR
  105. (d) Express what we have left after making our payment as a number.
  106. \{ $total->ans_rule() \}
  107.  
  108. END_TEXT
  109. Context()->normalStrings;
  110.  
  111. ANS( $popup1->cmp() );
  112. ANS( $popup2->cmp() );
  113. ANS( $popup3->cmp() );
  114. ANS( $total->cmp() );
  115.  
  116. Section::End();
  117. ##############################################################
  118. Section::Begin("Part 2: Buying an apartment");
  119.  
  120. Context()->texStrings;
  121. BEGIN_TEXT
  122. $PAR
  123. Let’s do another example. Say we want to purchase an apartment, and we have $$down saved up for a down payment. We find an apartment that we want to buy, but it will cost us $$cost.
  124. $PAR
  125. $PAR
  126. (a) If we buy this apartment, will we have money left over? Or will we go into debt? \{ $popup4->menu() \}
  127. $PAR
  128. (b) So, will we express the result of our purchase as a positive or negative number? \{ $popup5->menu() \}
  129. $PAR
  130. (c) Express the result of our purchase as a number. \{ $loan->ans_rule() \}
  131.  
  132. END_TEXT
  133. Context()->normalStrings;
  134.  
  135. ANS( $popup4->cmp() );
  136. ANS( $popup5->cmp() );
  137. ANS( $loan->cmp() );
  138.  
  139. Section::End();
  140.  
  141. ##############################################################
  142. Section::Begin("Part 3: Consolidating debts");
  143.  
  144. Context()->texStrings;
  145. BEGIN_TEXT
  146.  
  147. As our final example, let’s consider what we’d have if both of the previous examples were combined. In the first example we ended up with a final debt of $$debt1, and in the second example, we ended up with a debt of $$debt2.
  148. $PAR
  149. $PAR
  150. (a) If we add the debts together, should it be expressed as a positive or negative number? \{ $popup6->menu() \}
  151. $PAR
  152. (b) Express our total debt as a number. \{ $totaldebt->ans_rule() \}
  153.  
  154. END_TEXT
  155. Context()->normalStrings;
  156.  
  157. ANS( $popup6->cmp() );
  158. ANS( $totaldebt->cmp() );
  159.  
  160. Section::End();
  161.  
  162. Scaffold::End();
  163.  
  164. ##############################################################
  165. #
  166. # Answers
  167. #
  168. #
  169.  
  170.  
  171. ENDDOCUMENT();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement