Question 1188617
Patrick bought a bag of sweets.
3/8 of the sweets were apple-flavoured and the rest were
strawberry-flavoured.
After giving away 8/9 of the apple-flavoured sweets and 42
strawberry-flavoured sweets to his friends, he had 1/12 of the sweets
left.
Patrick paid $0.20 for each sweet.
How much did Patrick pay for the bag of sweets at first?
<pre>The pluggable "gadget" is extremely inefficient and does not serve any purpose in teaching someone
to solve a problem. I guess to some it's cute and entertaining! And, I believe it's a lazy person's tool.

Let multiplicative factor for original number of sweets be x
Then original numbers of apple-flavored and strawberry-flavored sweets are: 3x and 5x, respectively
Then total number of sweets = 3x + 5x = 8x
After {{{8/9}}} of the apple-flavored are given away, {{{matrix(1,5, 1/9, of, 3x, or, x/3)}}} remain
After 42 of the strawberry-flavored are given away, 5x - 42 remain
Since {{{1/12}}} of the total number of sweets remain, we get: {{{system(matrix(1,5, x/3 + 5x - 42, "=", 1/12, of, 8x), matrix(1,3, x/3 + 5x - 42, "=", 2x/3))}}}
x + 15x - 126 = 2x ---- Multiplying by LCD, 3
        - 126 = 2x - 16x
        - 126 = - 14x
Multiplicative factor for original number of sweets, or {{{matrix(1,5, x, "=", (- 126)/(- 14), "=", 9)}}}
Original number of sweets: {{{highlight_green(matrix(1,3, 8(9), "=", 72))}}}

Cost of original 72 sweets, at $0.20 per sweet: <font color = red><font size = 4><b> 72(.20) = $14.40</font></font></b></pre>