There are two main ways to figure this problem out. The first (and most systematic) is to use calculus. However, seeing that you are in 9th grade, I assume that you are not in calculus, so we'll take an alternate approach.
A way to think about this is that, for our our purposes, the time the ball takes to go up is the same amount of time the ball takes to get back to the floor.
This means that our maximum height would be found at the point in time halfway between t = 0 and the time at which the shell hits the ground again (the second point at which h = 0).
To find the time that the shell hits the ground, we'll just solve the above equation for when h(t) = 0:
`0 = 50t - 5t^2`
Now, we know that both terms have a "t" in them, so we can simply factor out a "t":
`0 = t(50-5t)`
Now, we have two cases because we know that in order for this equation to be true, either t = 0 or 50-5t = 0:
This case is the trivial case that we knew already. At the starting time, t = 0, the shell was at height h = 0. Let's move on.
2) `50 - 5t = 0`
Let's start by subtracting 50 from both sides.
`-5t = -50`
Now, we can divide both sides by -5:
`t = 10`
There's the solution we've been looking for, the time when the shell his the ground after it was fired.
Now, we know the time at which the shell was fired, and we know the time at which it hit the ground. It stands to reason that the maximum height that the shell reaches would be right at the middle of times t = 0 and t = 10. In other words, we expect the maximum height to be at t = 5.
This analysis is confirmed by graphing the function:
Clearly at t = 5, we've reached our maximum height.
Now, to find the height we reach, we simply evaluate h(t) at t = 5:
`h(5) = 50(5) - 5(5^2)`
`h(5) = 250 - 125 = 125`
So, our maximum height ends up being 125 m.
Hope that helps!
Go ahead and see the link below for more info on trajectory.