Yes, in third grade they learn the formula for 'cuboids' or rectangular prisms (or boxes to the average 9-year-old). However, other than calling it a cube, the rest of the information is just fine. You don't need to deduce anything (other than the volume)...the information is given. The 'base' (or cross-sectional area of the prism) is 40 square feet. This represents two of the three dimensions of our prism. Knowing the area of the base, we can multiply that by our third dimension (the height) to determine the volume of the prism.
Perhaps you can attend that refresher course with the OP's teacher?