Let the number of sodas be s and the number of hotdogs be h
Since there are 172 sodas and hot dogs, then
Add s and h, then equate the sum by 172
[tex]s+h=172\rightarrow(1)[/tex]Since the number of sodas is three times the number of hot dogs
That means s is equal to 3h
[tex]s=3h\rightarrow(2)[/tex]Now, substitute s in equation (1) by equation (2)
[tex]\begin{gathered} 3h+h=172 \\ 4h=172 \end{gathered}[/tex]Divide both sides by 4
[tex]\begin{gathered} \frac{4h}{4}=\frac{172}{4} \\ h=43 \end{gathered}[/tex]Substitute h in equation 2 by 43
[tex]\begin{gathered} s=3(43) \\ s=129 \end{gathered}[/tex]The answer is
The number of sodas sold: 129
The number of hot dogs sold: 43