Set up 2 equations:
Total items sold: x + y = 300
This gets rewritten as x = 300-y
The second equation is for total amount made:
2.50x + 1.50y = 522
Replace x in the 2nd equation with the value of x from the first one:
2.50(300-y) + 1.50y = 522
Simplify:
750 - 2.50y + 1.50y = 522
Combine like terms:
750 - y = 522
Subtract 750 from both sides:
-y = -228
Divide both sides by -1 ( to make y positive)
y = 228
Now replace y in the first equation to solve for x:
x+ 228 = 300
Subtract 228 from both sides:
x = 72
He sold 72 bags of popcorn and 228 sodas.