Question: In C++: 1. The figure below describes a main program that invokes a function computeAveVolume () to compute : the number of shapes in a

In C++:

In C++: 1. The figure below describes a main program that invokesa function computeAveVolume () to compute : the number of shapes in

1. The figure below describes a main program that invokes a function computeAveVolume () to compute : the number of shapes in a vector the total and average volume of all shapes stored in the vector #include #include #include using namespace std; typedef struct Shape 3D { string name, color; double volume; 1 Shape 3DType; void computeAveVolume (vector shape 3DVec, int* outi, double* out2, double* out3); int main() [ Shape 3DType shapeArray [4]; shapeArray (0) {"Sphere", "Green" shapeArray [1] = ("Cube", "Yellow" shapeArray [2] = ("Tetrahedron", "Red", shapeArray [3] = ("Cylinder", "Blue", 100.11); 200.22); 300.33); 400.44); vector shapeRecs Vector (shapeArray, shapeArray + sizeof (shapeArray) / sizeof (Shape 3DType)); int noofShapes = -1; double totVolume = 0; double aveVolume = 0; computeAveVolume (shapeRecs Vector, &noof Shapes, &totVolume, &aveVolume); cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!