Ask Question
27 February, 00:14

Define a function pyramid volume with double parameters baselength, basewidth, and pyramid height, that returns as a double the volume of a pyramid with a rectangular base. relevant geometry equations: volume = base area x height x 1/3 base area = base length x base width. (watch out for integer division).

+1
Answers (1)
  1. 27 February, 02:09
    0
    Declaring the volume function double PyramidVolume (double baseLength, double baseWidth, double pyramidHeight) { double baseArea = baseLength * baseWidth; double vol = ((baseArea * pyramidHeight) * 1/3); return vol; } int main () { cout << "Volume for 1.0, 1.0, 1.0 is: " << PyramidVolume (1.0, 1.0, 1.0) << endl; return 0; } Defining the function, include double PyramidVolume (double, double, double); int main () { std::cout << "Volume for 1.0, 1.0, 1.0 is: " << PyramidVolume (1.0, 1.0, 1.0) << std::endl; return 0; } double PyramidVolume (double length, double width, double height) { return length * width * height / 3; }
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Define a function pyramid volume with double parameters baselength, basewidth, and pyramid height, that returns as a double the volume of a ...” in 📙 Mathematics if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers