Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. The figure below describes a main program that invokes a function computeAveVolume () to compute : the number of shapes in a vector the
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; ) Shape 3DType; void computeAveVolume (vector shape 3Dec, int* outi, double* out2, double* out 3); int main() 1 Shape 3DType shapeArray [4]; shapeArray [0] = {"Sphere", "Green", 100.11); shapeArray (1) "Cube", "Yellow" 200.22); shapeArray [2] = "Tetrahedron", "Red", 300.33); shapeArray (3) ("Cylinder", "Blue", 400.44); vector shapeRecs Vector (shapeArray, shapeArray + sizeof (shapeArray) / sizeof (Shape 3DType)); int noofShapes = -1; double totVolume = 0; double aveVolume = 0; computeAveVolume (shapeRecs Vector, &noofShapes, &totVolume, &aveVolume); cout
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started