To find the height \( h \) of the square pyramid using the Pythagorean theorem, we have the following information:
- The slant height \( l \) of the pyramid is given as 25 feet.
- The front base edge, which is a side of the base of the pyramid, is given as 40 feet.
First, we need to find the distance from the center of the base to the midpoint of one of the base edges. Since the base is square and each side is 40 feet, the distance from the center to the midpoint of one side is half of 40 feet:
\[ \text{Distance from center to midpoint} = \frac{40}{2} = 20 \text{ feet} \]
Now, we can apply the Pythagorean theorem in the right triangle formed by the height \( h \), the half base edge (20 feet), and the slant height (25 feet).
According to the Pythagorean theorem:
\[ l^2 = h^2 + \left( \frac{\text{Base Edge}}{2} \right)^2 \]
Substituting the known values:
\[ 25^2 = h^2 + 20^2 \]
Calculating the squares:
\[ 625 = h^2 + 400 \]
Now, solve for \( h^2 \):
\[ h^2 = 625 - 400 \] \[ h^2 = 225 \]
Taking the square root of both sides:
\[ h = \sqrt{225} = 15 \text{ feet} \]
Thus, the height \( h \) of the square pyramid is:
\[ \boxed{15.0 \text{ ft.}} \]