We'll assume that the whole scene takes place on Earth.
So the acceleration of gravity is 9.8 m/s² downward.
a). Gravity makes anything fall 9.8 m/s faster every second.
That's the same thing as rising 9.8 m/s slower every second.
If it takes 2.9 seconds to reach its maximum height, then
it must have started out rising at (9.8 x 2.9) = 28.4 m/s.
b). The ball left the bat at 28.4 m/s.
After 2.9 seconds, its speed was zero. (That's why it started falling.)
It's average speed during the climb was
1/2 (28.4 + 0) = 14.2 m/s .
It rose straight up at an average speed of 14.2 m/s for 2.9 seconds,
so it reached a maximum height of
(14.2 x 2.9) = 41.2 meters .