Answer: Each cookie cost $1.25 and each cake $15
Explanation:
Let's call Co to the price of a cookie, and Ca to the price of a cake; we have that:
3*Co + 5*Ca = $78.75
8*Co + 2*Ca = $40
Now we have a system of equations and we want to solve it, the first step is isolating one of the variables in one of the equations, let's isolate Ca in the second equation:
2*Ca = $40 - 8*Co
Ca = ($40 - 8*Co)/2 = $20 - 4*Co
Now we can replace it in the first equation, and get:
3*Co + 5*($20 - 4*Co) = $78.75
3*Co + $100 -20*Co = $78.75
-17*Co = $78.75 - $100 = -$21.25
Co = $21.25/17 = $1.25
now we can replace this value in one of the equations and get the price for a cake.
8*$1.25 + 2*Ca = $40
Ca = $20 - 4*$1.25 = $20 - $5 = $15
Each cookie cost $1.25 and each cake $15