let s = the number of sodas sold and h = the number of hotdogs sold, we have s + h = 184 (1)
and s = h + 40 (2) plugging the value of s from (2) to (1) we get h+40+h=184 -->> 2h=184-40 --->>>
2h=144 and h=144/2 =72 so h = 72 so S=184-h (1) so s=184-72=112
so 72 hotdogs and 112 sodas were sold