Answer
Time: $12.5$ seconds
Maximum height: $2540$ feet
Work Step by Step
The quadratic function
$$s(t)=-16t^2+400t+40$$
has negative leading coefficient, therefore its graph is a parabola which opens downward and has a maximum in the vertex.
Bring the function to the vertex form $f(x)=a(x-h)^2+k$:
$$\begin{align*}
s(t)&=-16t^2+400t+40\\
&=-16(t^2-25t)+40\\
&=-16(t^2-25t+12.5^2)+16(12.5^2)+40\\
&=-16(t-12.5)^2+2540.
\end{align*}$$
Identify the constants $a$, $h$, $k$:
$$\begin{align*}
a&=-16\\
h&=12.5\\
k&=2540.
\end{align*}$$
Determine the vertex of the function:
$$(h,k)=(12.5,2540).$$
So the amount of time until the rocket reaches its maximum height is $12.5$ seconds, while the maximum height is $2540$ feet.