let = side length of the square base and top

= box height

volume ...

let = cost of the box in cents (if you want dollars, change to decimals)

solve for in the volume equation, substitute the result into the cost equation to get cost strictly as a function of ... minimize the cost like you were taught in class.