Let d = number of hotdogs
Let b = number of burgers
8 total so
b + d = 8
Total cost was $14.50 so
1.5d + 2b = 14.50
Solve for b in the first equation to get b = 8 - d
Substitute this expression for b into the second equation.
1.5d + 2b = 14.50 becomes 1.5d + 2(8 - d) = 14.50
Now we have an equation with a single variable so solve for d
1.5d + 16 - 2d = 14.50
-0.5d + 16 = 14.50
-0.5d = -1.50
d = 3
If d = 3, then b = 5