At a candy store, Gavin bought 2 kilograms of jelly beans and 2 kilograms of gummy worms for $32. Meanwhile, Dustin bought 2 kilograms of jelly beans and 1 kilogram of gummy worms for $25. How much does each candy cost?
Let x be the cost of a kilogram of jelly beans and y the cost of a kilogram of gummy worms. We form two equations:
We have a system of equations now and we solve for x and y.
Subtracting 2x+y=25 from 2x+2y=32, we get y=7. Then we plug the y value into 2x+y=25 to get the value of x.
Therefore jelly beans cost $9 per kilogram and gummy worms $7 per kilogram.