Given:
The total number of hats, h=31.
The total number of shoes, s=96.
Let c be the number of cats and p be the number of parrots.
Hence, the expression for the total number of hats can be written as,
[tex]h=c+p\text{ ---(1)}[/tex]A cat has 4 legs. So, the total number of shoes for cats is 4c.
A parrot has 2 legs. So, the total number of shoes for parrots is 2p.
Now, the expression for the total number of shoes can be written as,
[tex]s=4c+2p\text{ ---(2)}[/tex]Multiply equation (1) by 2.
[tex]2h=2c+2p\text{ ---(3)}[/tex]Now, subtract equation (3) from equation (2).
[tex]\begin{gathered} s-2h=4c-2c \\ s-2h=2c \\ c=\frac{s-2h}{2} \end{gathered}[/tex]Substitute the known values in the above equation to find the number of cats c.
[tex]\begin{gathered} c=\frac{96-2\times31}{2} \\ =\frac{96-62}{2} \\ =\frac{34}{2} \\ =17 \end{gathered}[/tex]Therefore, the number of cats Smith has is 17.