Yes, in the equation Vy = 20 m/s sin 40 - g t, g represents the acceleration due to gravity, which is approximately 9.8 m/s^2. And t is the time it takes for the ball to reach the plane of the fence, which you calculated in the first question.
If you got a negative answer for Vy, it simply means that the vertical component of velocity is in the downward direction. In this case, the negative sign indicates that the ball is moving downward. In physics, we usually take the upward direction as positive, so a negative velocity means the ball is moving in the opposite direction. However, we are only concerned with the magnitude of the velocity for this question, so you can ignore the negative sign when calculating the final answer.