The maximum height at which the baseball will reach is given by the formula
Vf^2 - Vo^2 = 2gh
where
Vf = final velocity = 0 (at its peak)
Vo = initial velocity = 22 m/sec (given)
g = acceleration due to gravity = 9.8 m/sec^2 (constant)
h = maximum height attained by the ball
Substituting appropriate values,
0 - (22)^2 = 9(-9.8)h
NOTE the negative sign attached to the acceleration due to gravity. This simply denotes that the ball is slowing down as it goes up.
Solving for "h",
h = 22^2/(2 * 9.8)
h = 24.69 meters
To solve for the time it reaches its maximum height, use the formula
h = VoT -(1/2)(gT^2)
where
T = time for ball to reach maximum height
and all the other terms have been previously defined.
Substituting values,
24.69 = 22T - (1/2)(9.8)T^2
Rearranging the above,
4.9T^2 - 22T + 24.69 = 0
Using the quadratic formula,
T = 2.22 seconds
NOTE --- the above is the time for the ball to reach its maximum height. The total time it is in the air is
Total time = 2(2.22) = 4.44 sec.
Hope this helps :)