Let:
T = Total money they have
Dc = Dog collar
x = Number of bags of food
[tex]\begin{gathered} 2x+Dc\le T \\ 2x+4.5\le30 \end{gathered}[/tex]Let's solve the inequality:
[tex]\begin{gathered} 2x+4.5\le30 \\ \text{subtract 4.5 from both sides:} \\ 2x+4.5-4.5\le30-4.5 \\ 2x\le25.5 \\ x\le\frac{25.5}{2} \\ x=12.75\approx12 \end{gathered}[/tex]This means that they can buy 12 bags of food at most.
Since they plan to buy 2 bags of food:
[tex]\begin{gathered} 2(7)+4.5\le30 \\ 14+4.5\le30 \\ 18.5\le30 \end{gathered}[/tex]This means they can do it and have $ 11.5 to spare