$20$
To solve this problem, we need to analyze the motion of the ball in two stages: ascending to the maximum height, and descending to the roof of the building.
Maximum Height Calculation:
We are given that the maximum height is reached in 2 seconds. For vertical motion, the time to reach maximum height \(t_{max}\) is related to the initial vertical velocity \(u_y\) by the formula:
\(t_{max} = \frac{u_y}{g}\)
Given \(t_{max} = 2\, \text{s}\) and \(g = 10\, \text{m/s}^2\), we find:
\(u_y = g \times t_{max} = 10 \times 2 = 20\, \text{m/s}\)
Horizontal and Vertical Components:
The launch angle is \(45^\circ\), so the initial velocity vector is split equally into horizontal and vertical components:
\(u_x = u_y = 20\, \text{m/s}\)
Total Time of Flight:
The total time of flight given is 3 seconds, meaning the ball lands on the building 1 second after reaching its maximum height.
Vertical Displacement Calculation:
Using the equation of motion for the vertical displacement from the maximum height to the roof (\(H\)), we have:
\(H = u_y \times t - \frac{1}{2} g \times t^2\)
Where \(t = 1\, \text{s}\) (time from max height to the roof):
\(H = 0 \times 1 - \frac{1}{2} \times 10 \times 1^2 = -5\, \text{m}\) from the max height.
Since the ball reaches max height at \(20\, \text{m}\) (calculation: \(H_{max} = \frac{u_y^2}{2g} = \frac{20^2}{2 \times 10} = 20\, \text{m}\)) from the launch point, at time \(t=3s\) it is \(20 - 5 = 15\) meters above the ground level.
Thus, the height of the building \(H = 15\, \text{m}\).
The correct answer is \(15\).