There's a problem with the question as given. Even with a maximum projection angle of θ = 90°, the initial velocity is not large enough to get the ball up in the air 160 m. With angle 90°, the ball's height y at time t would be
y = (40 m/s) t - 1/2 g t ²
Set y = 160 m, and you'll find that there is no (real) solution for t, so the ball never attains the given maximum height.
From another perspective: recall that
v ² - v₀² = 2a ∆y
where
• v₀ = initial velocity
• v = final velocity
• a = acceleration
• ∆y = displacement
At its maximum height, the ball has zero vertical velocity, and ∆y = maximum height = 160 m. The ball is in free fall once it's launched, so a = -g.
So we have
0² - (40 m/s)² = -2g (160 m)
but this reduces to
(40 m/s)² = 2 (9.8 m/s²) (160 m)
1600 m²/s² ≠ 3136 m²/s²