first we make 2 equations from the given info
let c = cats & b = birds


^ because cats have 4 legs and birds have 2
now next we want to solve for one of the variable in the first equation, then plug it into the second one
so..

now plug it in

simplify


now all we have to do is put 7 back into our first equation


7 cats
4 birds