ask the user to select one of the three geometric- a cylinder, box, or sphere-an
ID: 3628270 • Letter: A
Question
ask the user to select one of the three geometric- a cylinder, box, or sphere-and to enter size information for the item. The program then calculates the volume and surface area for the item by using calculateVolume and CalculatSurfaceArea functions. The program should declare data varibles for volume, surface area, radius, height, length, width. Using a getShape function, ask the user to select an item and ask for pertinent dimensions. If the data is valid call CalculatVolume and CalculateSurfaceArea. The three overload volume and three overloaded surface area functions should all have the same name but different prototypes. Use the three overload functions called write results to report the calculated values for your shape.If the shape choice is invalid, the main fuction should report error and ask if they would like to perform another shape calculation.
Explanation / Answer
DEAR FRIEND here is the program u want any questions message me PLEASE RATE #include #include using namespace std; double CalculateVolume(double radius,double height) { double volume; volume=(3.14)*pow(radius,2.0)*height; return volume; } double CalculateVolume(double height,double width,double I) { double volume; volume=height*width*I; return volume; } double CalculateVolume(double radius) { double volume; volume=(4/3)*(3.14)* ( pow(radius,3) ); return volume; } double CalculateSurfaceArea(double radius) { double area; area=4*(3.14)*(pow(radius,2)); return area; } double CalculateSurfaceArea(double height,double width,double I) { double ar[3]; double area=0; ar[0]=height*width; ar[1]=height*I; ar[2]=width*I; for(int i=0; iRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.