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