Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c++ Programming 1. The figure below describes a maino program that invokes a function computeAveVolume () to compute : the number of shapes in a

c++ Programming

image text in transcribed

image text in transcribed

1. The figure below describes a maino 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 3 DVec, int* outi, double* out2, double* out3); int main() { Shape 3DType shapeArray [4]; shapeArray [0] shapeArray (1) shapeArray (2) shapeArray (3) {"Sphere", "Green", { "Cube", "Yellow", { "Tetrahedron", "Red", { "Cylinder", "Blue", 100.11); 200.22}; 300.33); 400.44}; vector shapeRecsVector (shapeArray, shapeArray + sizeof (shapeArray) / sizeof (Shape 3DType)); int noofShapes = -1; double totVolume = 0; double aveVolume = 0; computeAveVolume (shape RecsVector, &noof Shapes, &totVolume, &aveVolume); cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Manga Guide To Databases

Authors: Mana Takahashi, Shoko Azuma, Co Ltd Trend

1st Edition

1593271905, 978-1593271909

More Books

Students also viewed these Databases questions