Permalink
Fetching contributors…
Cannot retrieve contributors at this time
329 lines (307 sloc) 19.9 KB
<!DOCTYPE html>
<html data-require="math word-problems spin graphie graphie-helpers-arithmetic">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Adding and subtracting decimals word problems</title>
<script data-main="../local-only/main.js" src="../local-only/require.js"></script>
</head>
<body>
<div class="exercise">
<div class="problems">
<div id="produceCost">
<div class="vars">
<var id="A">randRange(5, 9) * 100</var>
<var id="B">randRange(1, 9) * 10</var>
<var id="C">randRange(1, 9)</var>
<var id="fruit_1_integer">A + B + C</var>
<var id="fruit_1_decimal">2</var>
<var id="fruit_1">truncate_to_max(fruit_1_integer * pow(10, -fruit_1_decimal), 2)</var>
<var id="D">randRange(3, 9) * 100</var>
<var id="E">randRange(1, 9) * 10</var>
<var id="F" data-ensure="F + C !== 10">randRange(1, 9)</var>
<var id="fruit_2_integer">D + E + F</var>
<var id="fruit_2_decimal">2</var>
<var id="fruit_2">truncate_to_max(fruit_2_integer * pow(10, -fruit_2_decimal), 2)</var>
<var id="solution">truncate_to_max((fruit_1 + fruit_2), 2)</var>
<var id="DUMMY">[]</var>
</div>
<div class="question spin">
<p data-if="isMale(1)">
{On a sunny morning|On a beautiful afternoon}, <var>person(1)</var>
rode his bicycle to a farm that sold baskets of <var>plural_form(fruit(1))</var> for <code>$<var>fruit_1</var></code>
each and baskets of <var>plural_form(fruit(2))</var> for <code>$<var>fruit_2</var></code> each.
</p><p data-else="">
{On a sunny morning|On a beautiful afternoon}, <var>person(1)</var>
rode her bicycle to a farm that sold baskets of <var>plural_form(fruit(1))</var> for <code>$<var>fruit_1</var></code>
each and baskets of <var>plural_form(fruit(2))</var> for <code>$<var>fruit_2</var></code> each.
</p>
<p data-if="isMale(1)">
<var>person(1)</var> decided to buy a basket of <var>plural_form(fruit(1))</var> and a basket of <var>plural_form(fruit(2))</var> {before heading home|because those were his favorite kinds of fruit|}.
</p><p data-else="">
<var>person(1)</var> decided to buy a basket of <var>plural_form(fruit(1))</var> and a basket of <var>plural_form(fruit(2))</var> {before heading home|because those were her favorite kinds of fruit|}.
</p>
<p class="question" data-if="isMale(1)">How much did <var>person(1)</var> need to pay for his produce?</p>
<p class="question" data-else="">How much did <var>person(1)</var> need to pay for her produce?</p>
</div>
<div class="solution" data-type="multiple">
<code>$</code><span class="sol"><var>fruit_1 + fruit_2</var></span>
</div>
<div class="hints">
<p>
To find the total amount <var>person(1)</var> needs to pay,
we need to add the price of the <var>plural_form(fruit(1))</var> and the price of the <var>plural_form(fruit(2))</var>.
</p>
<p>Price of <var>plural_form(fruit(1))</var> + price of <var>plural_form(fruit(2))</var> = total price.</p>
<div class="graphie" id="numbers">
graph.adder = new Adder(fruit_1_integer, fruit_2_integer, fruit_1_decimal, fruit_2_decimal);
graph.adder.show();
</div>
<div class="graphie" data-each="Adder.numHintsFor(fruit_1_integer, fruit_2_integer, fruit_1_decimal, fruit_2_decimal) times" data-update="numbers">
graph.adder.showHint();
</div>
<p><var>person(1)</var> needs to pay <code>$<var>solution</var></code>.</p>
</div>
</div>
<div id="racers">
<div class="vars">
<var id="meters">randRange(1, 4) * 100</var>
<var id="time_1_integer">randRange(meters * 15, meters * 30)</var>
<var id="time_1_decimal">2</var>
<var id="time_1">truncate_to_max(time_1_integer * pow(10, -time_1_decimal), 2)</var>
<var id="time_2_integer" data-ensure="time_2_integer < time_1_integer">randRange(meters * 15, meters * 30)</var>
<var id="time_2_decimal">2</var>
<var id="time_2">truncate_to_max(time_2_integer * pow(10, -time_2_decimal), 2)</var>
<var id="time_3_integer">randRange(100, 999)</var>
<var id="time_3_decimal">2</var>
<var id="time_3">truncate_to_max(time_3_integer * pow(10, -time_3_decimal), 2)</var>
<var id="DUMMY">[]</var>
<var id="solution">truncate_to_max((time_1 - time_2), 2)</var>
</div>
<div class="question spin">
<p>
{On Monday|Last week}, <var>person(1)</var> and <var>person(2)</var> decided to see how fast they could sprint
<code><var>meters</var></code> meters. They asked their friend <var>person(3)</var> to time them with a stopwatch.
</p><p data-if="isMale(2)">
{After <code><var>time_3</var></code> minutes, <var>person(3)</var> agreed to time the runners.|}
<var>person(1)</var> sprinted first and ran <code><var>meters</var></code> meters in <code><var>time_1</var></code> seconds.
When it was <var>person(2)</var>'s turn, he sped off and completed the run in <code><var>time_2</var></code> seconds.
</p><p data-else="">
{After <code><var>time_3</var></code> minutes, <var>person(3)</var> agreed to time the runners.|}
<var>person(1)</var> sprinted first and ran <code><var>meters</var></code> meters in <code><var>time_1</var></code> seconds.
When it was <var>person(2)</var>'s turn, she sped off and completed the run in <code><var>time_2</var></code> seconds.
</p>
<p class="question">How much faster was <var>person(2)</var> than <var>person(1)</var> in seconds?</p>
</div>
<div class="solution" data-type="multiple">
<p><span class="sol" data-forms="integer, decimal"><var>time_1 - time_2 </var></span> seconds</p>
</div>
<div class="hints">
<p>
To find how much faster <var>person(2)</var> was than <var>person(1)</var>,
we need to find the difference between their times in seconds.
</p>
<p><var>person(1)</var>'s time - <var>person(2)</var>'s time = difference in times.</p>
<div class="graphie" id="numbers">
graph.subtractor = new DecimalSubtractor(time_1_integer, time_1_decimal, time_2_integer, time_2_decimal);
graph.subtractor.show();
graph.subtractor.showDecimals();
</div>
<div class="graphie" data-each="DecimalSubtractor.numHintsFor(time_1_integer, time_1_decimal, time_2_integer, time_2_decimal) times" data-update="numbers">
graph.subtractor.showHint();
</div>
<p><var>person(2)</var> was <code><var>solution</var></code> seconds faster than <var>person(1)</var>.</p>
</div>
</div>
<div id="twinWeight">
<div class="vars">
<var id="weight_1_integer">randRange(250, 500)</var>
<var id="weight_1_decimal">2</var>
<var id="weight_1">truncate_to_max(weight_1_integer * pow(10, -weight_1_decimal), 2)</var>
<var id="weight_2_integer">randRange(250, 500)</var>
<var id="weight_2_decimal">2</var>
<var id="weight_2">truncate_to_max(weight_2_integer * pow(10, -weight_2_decimal), 2)</var>
<var id="height_1">randRange(90, 110) / 2</var>
<var id="height_2">randRange(90, 110) / 2</var>
<var id="solution">truncate_to_max((weight_1 + weight_2), 2)</var>
<var id="DUMMY">[]</var>
</div>
<div class="question spin">
<p>
{Last Monday|On Saturday}, <var>person(1)</var>'s mother gave birth to twins
and named them <var>person(2)</var> and <var>person(3)</var>.
When they were first born, <var>person(2)</var> weighed <code><var>weight_1</var></code> kilograms
{and was <code><var>height_1</var></code> centimeters tall|}, and <var>person(3)</var> weighed <code><var>weight_2</var></code> kilograms
{and was <code><var>height_2</var></code> centimeters tall|}.
</p>
<p class="question">How much did the babies weigh in total?</p>
</div>
<div class="solution" data-type="multiple">
<p><span class="sol" data-forms="integer, decimal"><var>weight_1 + weight_2</var></span> kilograms</p>
</div>
<div class="hints">
<p>To find the weights of the two babies, we need to add their weights together.</p>
<p><var>person(2)</var>'s weight + <var>person(3)</var>'s weight = total weight.</p>
<div class="graphie" id="numbers">
graph.adder = new Adder(weight_1_integer, weight_2_integer, weight_1_decimal, weight_2_decimal);
graph.adder.show();
</div>
<div class="graphie" data-each="Adder.numHintsFor(weight_1_integer, weight_2_integer, weight_1_decimal, weight_2_decimal) times" data-update="numbers">
graph.adder.showHint();
</div>
<div class="graphie" data-each="DUMMY as dummy" data-update="numbers">
graph.adder.showHint();
</div>
<p>Together, the babies weigh <code><var>solution</var></code> kilograms.</p>
</div>
</div>
<div id="change">
<div class="vars">
<var id="M">randRange(1, 9)</var>
<var id="N">randRange(1, 9)</var>
<var id="O">randRange(2, 9)</var>
<var id="amount_paid_integer">M * 100 + N * 10 + O</var>
<var id="amount_paid_decimal">2</var>
<var id="amount_paid">truncate_to_max(amount_paid_integer * pow(10, -amount_paid_decimal), 2)</var>
<var id="P">randRange(1, M) * 100</var>
<var id="Q">randRange(1, N) * 10</var>
<var id="R">randRange(1, O)</var>
<var id="price_1_integer">P + Q + R</var>
<var id="price_1_decimal">(2)</var>
<var id="price_1">truncate_to_max(price_1_integer * pow(10, -price_1_decimal), 2)</var>
<var id="time_1">randRange(3, 30)</var>
<var id="solution">truncate_to_max((amount_paid-price_1), 2)</var>
<var id="DUMMY">[]</var>
</div>
<div class="question spin">
<p data-if="isMale(1)">
{On Tuesday,|Last Thursday,|} <var>person(1)</var> walked to a <var>store(1)</var> store {<var>timeofday(1)</var>|} and
{, after browsing for <code><var>time_1</var></code> minutes,|} decided to buy a <var>storeItem(1, 1)</var> for
<code>$<var>price_1</var></code>. <var>person(1)</var> handed the salesperson <code>$<var>amount_paid</var></code> for his purchase.
</p><p data-else="">
{On Tuesday,|Last Thursday,|} <var>person(1)</var> walked to a <var>store(1)</var> store {<var>timeofday(1)</var>|} and
{, after browsing for <code><var>time_1</var></code> minutes,|} decided to buy a <var>storeItem(1, 1)</var> for
<code>$<var>price_1</var></code>. <var>person(1)</var> handed the salesperson <code>$<var>amount_paid</var></code> for her purchase.
</p>
<p class="question">How much change did <var>person(1)</var> receive?</p>
</div>
<div class="solution" data-type="multiple">
<code>$</code> <span class="sol"><var>amount_paid - price_1</var></span>
</div>
<div class="hints">
<p data-if="isMale(1)">
To find out how much change <var>person(1)</var> received, we can subtract the price of the
<var>storeItem(1,1)</var> from the amount of money he paid.
</p><p data-else="">
To find out how much change <var>person(1)</var> received, we can subtract the price of the
<var>storeItem(1,1)</var> from the amount of money she paid.
</p>
<p>
The amount <var>person(1)</var> paid - the price of the <var>storeItem(1,1)</var> =
the amount of change <var>person(1)</var> received.
</p>
<div class="graphie" id="numbers">
graph.subtractor = new DecimalSubtractor(amount_paid_integer, amount_paid_decimal, price_1_integer, price_1_decimal);
graph.subtractor.show();
graph.subtractor.showDecimals();
</div>
<div class="graphie" data-each="DecimalSubtractor.numHintsFor(amount_paid_integer, amount_paid_decimal, price_1_integer, price_1_decimal) times" data-update="numbers">
graph.subtractor.showHint();
</div>
<p class="final_answer"><var>person(1)</var> received <code>$<var>solution</var></code> in change.</p>
</div>
</div>
<div id="rainfall">
<div class="vars">
<var id="rain_1_integer">randRange(101, 999)</var>
<var id="rain_1_decimal">2</var>
<var id="rain_1">truncate_to_max(rain_1_integer * pow(10, -rain_1_decimal), 2)</var>
<var id="rain_2_integer">randRange(rain_1_integer + 1, 999)</var>
<var id="rain_2_decimal">2</var>
<var id="rain_2">truncate_to_max(rain_2_integer * pow(10, -rain_2_decimal), 2)</var>
<var id="snow_1">randRange(210, 1589) / 100</var>
<var id="DUMMY">[]</var>
<var id="solution">truncate_to_max((rain_2-rain_1), 2)</var>
</div>
<div class="question spin">
<p>
During a recent rainstorm, <code><var>rain_1</var></code> centimeters of rain fell in <var>person(1)</var>'s hometown,
and <code><var>rain_2</var></code> centimeters of rain fell in <var>person(2)</var>'s hometown.
{During the same storm, <code><var>snow_1</var></code> centimeters of snow fell in <var>person(3)</var>'s hometown.|}
</p>
<p class="question">How much more rain fell in <var>person(2)</var>'s town than in <var>person(1)</var>'s town?</p>
</div>
<div class="solution" data-type="multiple">
<p> <span class="sol" data-forms="integer, decimal"><var>rain_2 - rain_1</var></span> centimeters</p>
</div>
<div class="hints">
<p>
To find the difference in rainfall, we can subtract the amount of rain in <var>person(1)</var>'s
town from the amount of rain in <var>person(2)</var>'s town.
</p>
<p>Rain in <var>person(2)</var>'s town - rain in <var>person(1)</var>'s town = the difference in rain between the two towns.</p>
<div class="graphie" id="numbers">
graph.subtractor = new DecimalSubtractor(rain_2_integer, rain_2_decimal, rain_1_integer, rain_1_decimal);
graph.subtractor.show();
graph.subtractor.showDecimals();
</div>
<div class="graphie" data-each="DecimalSubtractor.numHintsFor(rain_2_integer, rain_2_decimal, rain_1_integer, rain_1_decimal) times" data-update="numbers">
graph.subtractor.showHint();
</div>
<p class="final_answer">
<var>person(2)</var>'s town received <code><var>solution</var></code> centimeters more rain than <var>person(1)</var>'s town.
</p>
</div>
</div>
<div id="travel">
<div class="vars">
<var id="distance_1_integer">randRange(100, 2000)</var>
<var id="distance_1_decimal">2</var>
<var id="distance_1">truncate_to_max(distance_1_integer * pow(10, -distance_1_decimal), 2)</var>
<var id="distance_2_integer">randRange(100, distance_1_integer - 1)</var>
<var id="distance_2_decimal">2</var>
<var id="distance_2">truncate_to_max(distance_2_integer * pow(10, -distance_2_decimal), 2)</var>
<var id="solution">truncate_to_max((distance_1 + distance_2), 2)</var>
<var id="time_1">randRange(2020, 5217) / 100</var>
<var id="DUMMY">[]</var>
</div>
<div class="question spin">
<p data-if="isMale(1)">
{To get to school each morning|To get to work each morning|To visit his grandmother},
<var>person(1)</var> takes a <var>vehicle(1)</var> <code><var>distance_1</var></code> <var>plural_form(distance(1), distance_1)</var>
and a <var>vehicle(2)</var> <code><var>distance_2</var></code> <var>plural_form(distance(1), distance_2)</var>.
{In total, the journey takes <code><var>time_1</var></code> minutes.|}
</p><p data-else="">
{To get to school each morning|To get to work each morning|To visit her grandmother},
<var>person(1)</var> takes a <var>vehicle(1)</var> <code><var>distance_1</var></code> <var>plural_form(distance(1), distance_1)</var>
and a <var>vehicle(2)</var> <code><var>distance_2</var></code> <var>plural_form(distance(1), distance_2)</var>.
{In total, the journey takes <code><var>time_1</var></code> minutes.|}
</p>
<p class="question">How many <var>plural_form(distance(1))</var> is <var>person(1)</var>'s journey in total?</p>
</div>
<div class="solution" data-type="multiple">
<p>
<span class="sol" data-forms="integer, decimal"><var>distance_1 + distance_2</var></span> <var>plural(distance(1))</var>
</p>
</div>
<div class="hints">
<p>To find the total distance <var>person(1)</var> travels, we need to add the two distances together.</p>
<p>Distance on <var>vehicle(1)</var> + distance on <var>vehicle(2)</var> = total distance.</p>
<div class="graphie" id="numbers">
graph.adder = new Adder(distance_1_integer, distance_2_integer, distance_1_decimal, distance_2_decimal);
graph.adder.show();
</div>
<div class="graphie" data-each="Adder.numHintsFor(distance_1_integer, distance_2_integer, distance_1_decimal, distance_2_decimal) times" data-update="numbers">
graph.adder.showHint();
</div>
<div class="graphie" data-each="DUMMY as dummy" data-update="numbers">
graph.adder.showHint();
</div>
<p class="final_answer">
<var>person(1)</var> travels <code><var>solution</var></code> <var>plural_form(distance(1), solution)</var> in total.
</p>
</div>
</div>
</div>
</div>
</body>
</html>