[tex]\bf \textit{V varies directly with l}\implies V=kl\qquad k=24\implies V=24l
\\\\\\
\textit{volume of the box, or a rectangular prism}\\\\
V=lwh\qquad
\begin{cases}
l=length\\
w=width\\
h=height\\
----------\\
k=24
\end{cases}\implies \boxed{lwh=24l}
\\\\\\
\textit{girth of the box }\\\\
w+w+h+h=20\implies 2w+2h=20\implies 2(w+h)=20
\\\\\\
thus\qquad w+h=\cfrac{20}{2}\implies \boxed{w=10-h}[/tex]
[tex]\bf \\\\
-------------------------------\\\\
lwh=24l\implies wh=24\implies (10-h)h=24\implies 10h-h^2=24
\\\\\\
0=h^2-10+24\implies 0=(h-6)(h-4)\implies h=
\begin{cases}
6\\
4
\end{cases}[/tex]
now, notice, we didn't use the length of 30inches.... since the "l"'s cancel each other anyway, so it doesn't weight much on what the value for "h" is, by simply doing the substution of "w" from the Girth.