A length of rope is stretched between the top edge of a building and a stake in the ground. The head of the stake is at ground level. The rope also touches a tree that is growing halfway between the stake and the building. If the building is 40 ft tall, how tall is the tree?

10 ft
20 ft
18 ft
80 ft

Let's call the height of the tree "x" feet.

Since the rope touches the top of the building and the ground level, the length of the rope is the same as the height of the building: 40 ft.
The rope also touches the tree, which is halfway between the stake and the building. This means that the length of the rope from the stake to the tree is also x feet.
So, the length of the rope from the tree to the building is 40 ft - x ft.
According to the triangle formed by the building, the stake, and the tree, the sum of the lengths of the two shorter sides is equal to the length of the longest side (the rope).
Using the Pythagorean theorem, we can write the equation: (40 - x)^2 + x^2 = 40^2.
Expanding and simplifying the equation, we get: 1600 - 80x + x^2 + x^2 = 1600.
Combining like terms, we have: 2x^2 - 80x = 0.
Factoring out 2x, we get: 2x(x - 40) = 0.
Setting each factor equal to zero, we have two possible solutions: 2x = 0, which gives us x = 0, or (x - 40) = 0, which gives us x = 40.
Since the tree cannot have a height of 0 feet, the only valid solution is x = 40.
Therefore, the height of the tree is 40 ft. Answer: \boxed{40\text{ ft}}.