Let's let h be the height of building B, and let x be the distance between the point on the roof of building A and the base of building B. We can use the tangent function to set up two equations with two unknowns:
tan(24) = h / x
tan(34) = h / (x + 35)
We can solve for h by eliminating x from these equations. We can do this by solving the first equation for x and substituting into the second equation:
x = h / tan(24)
tan(34) = h / (h / tan(24) + 35)
Simplifying this equation, we get:
h = (35 * tan(24) * tan(34)) / (tan(34) - tan(24))
Plugging in the values, we get:
h = 22.7 meters
So building B is 22.7 meters tall. To find the height of building A, we can use the equation:
x = h / tan(24)
Plugging in the values, we get:
x = 55.1 meters
So building A is 55.1 meters tall.