x+y=45
x=y+7
Use substitution...
Plug y+7 into the first equation. You get (y+7)+y=45. Next combine the like terms. 2y+7=45. Subtract 7 from both sides and you get 38. Divide 2 on both sides to get y alone and you get 19. Since there are more cats than dogs, this is the amount of dogs. Add 19+7 since there are 7 more cats than dogs and you get 26 cats. Therefore there is 19 dogs and 26 cats.