The average age of the dogs in a pet daycare is 5, and the average age of the cats at the same daycare is 9. The average age of all the dogs and the cars is 6. If there are total of 60 dogs and the cats at the pet daycare, how many dogs are there?

if there are d dogs, there are 60-d cats. So, adding up all their ages,

5d+9c = 6(60)
5d + 9(60-d) = 6(60)
5d + 540 - 9d = 360
4d = 180
d = 45

check:
45*5 = 225
15*9 = 135
-----------
60*6 = 360