Final answer:
There are 30 boys and 10 dogs.
Step-by-step explanation:
Let's use a system of equations to solve this problem. Let's say that the number of boys is 'B' and the number of dogs is 'D'.
Each person has one head, so the total number of heads is B + D = 40.
Each person has two feet, so the total number of feet is 2B + 4D = 100.
Now, we can solve this system of equations to find the values of B and D.
From the first equation, we can solve for B: B = 40 - D.
Substitute this value into the second equation: 2(40 - D) + 4D = 100
Solve for D: 80 - 2D + 4D = 100, 2D = 20, D = 10.
Now substitute this value back into the first equation to solve for B: B = 40 - 10, B = 30.
Therefore, there are 30 boys and 10 dogs.