Explanation:
Let M&Ms be=x and Starburts be=y
According to first condition
4x+2y=8.34-eq no 1
According to second condition
2x+3y=6.15-eq no 2
now, multiplying eq no 1 by 3 and eq no 2 by 2 and subtracting eq no 2 from eq 1
12x+6y=25.02
-4x-6y=-12.3
8x=12.72
x=12.72/8
x=1.59
Putting the value of x in eq 1
4*1.59+2y=8.34
6.36+2y=8.34
2y=1.98
y=1.98/2
y=0.99
Hence,the m&ms costed 1.59 and Starbursts costed 0.99