94.4k views
3 votes
Define a method pyramidVolume with double parameters baseLength, baseWidth, and pyramidHeight, that returns as a double the volume of a pyramid with a rectangular base.

User Schcriher
by
5.7k points

1 Answer

7 votes

Answer:

double pyramidVolume(double baseLength, double baseWidth, double pyramidHeight)

{

return baseLength * baseWidth * pyramidHeight / 3.0;

}

User Daniel Stoyanoff
by
4.7k points