Step 1: Set up the vertical motion the direct way.
Take the top of the building as the origin and downward as the positive direction, since that is where the ball ends up. The vertical component of the launch velocity, taken as positive upward, is $u_y = u\sin\theta = 15 \times \sin 30^\circ = 7.5\ \text{m/s}$.
Step 2: Write the height as a single clean expression.
In time $t$, the ball's position below the launch point is
\[
h = \frac{1}{2}g t^2 - u_y t
\]
This form already builds in the fact that gravity pulls it down while the initial upward push slows that fall, so there is no need to track a negative sign afterwards.
Step 3: Substitute the numbers.
\[
h = \frac{1}{2}(10)(3)^2 - (7.5)(3) = 45 - 22.5 = 22.5\ \text{m}
\]
Step 4: Sanity check.
At $t = 3$ s the vertical velocity is $u_y - gt = 7.5 - 30 = -22.5\ \text{m/s}$, well past zero, confirming the ball has long since turned around and is falling when it lands, which is consistent with a positive height.
Step 5: Conclusion.
The height of the building is
\[
\boxed{22.5\ \text{m}}
\]