So for this question we need to make a triangle.
So:
|\
| \23
|_\
7
Imagine the hypotenuse is the ladder (23ft) and the straight line is the wall, so the base is the space between the ladder and the wall (7ft).
So to find the angle of elevation it would be the angle in the bottom right, as that is the angle that the ladder is slanted at. As this is a right angle triangle you can use SOH CAH TOA
So we have h (23) and a(7) so we can do inverse cos 7/23 to get 72.28.... degrees which rounds to 72.3.
Then to find the height on the building we can use Pythagoras’ theorem:
A^2 + b^2 = c^2 where c is the hypotenuse.
So we know c= 23 and b= 7
So we rearrange to get
C^2 - b^2 = a^2
So
529 - 49 = 480 which is a^2 so we square root that to get 21.9.... which rounds to 22 feet.