Since we want to find the height reached by the ball, we only want to consider the vertical component of the ball's velocity. Using trigonometry, the y component will be:
vy= 15 * sin (45) = 10.6 m/s
In order to find the right kinematic equation, we consider which variables are known, and which are missing. The velocity is known, the displacement is the value we want to find, acceleration is not explicitly stated, but it is known to be g; the only missing variable is time. Therefore, we use the equation:
v2 = u2 - 2gh
Where h is the height reached by the ball. At maximum height, we know v = 0, so we get:
vy = sqrt(2gh) => h = vy2/2g = 5.7 m
Since 5.7m is larger than the ceiling height, we know the ball will hit the ceiling.