In the first one put 2. and in the second one put 7
Your equation should be
$4(40 tickets) + $5(X) = $400
160 +5x = 400
-160 -160
0 5x = 340
divide both sides by 5
5x/5 = 340/5
x = 68
so they need to sell 68 tickets at the door.
4(40) + 5(68) = 400
160 + 340 + 400
400 + 400
The answer is to your question is 100:1