*Write a program that ask the user to select one of the three geometric shapes,
ID: 3628258 • Letter: #
Question
*Write a program that ask the user to select one of the three geometric shapes, a cylinder, box, or sphere and to enter size information for tat item. The program then calculates the volume and surface area for the items by using CalculateVolume and CalculateSurfaceArea functions.*Your program should declare variables for volume, surface area, radius, height, length, and width. Devise a method so that you know which shape (cylinder, box, sphere) the user has chosen. Document this scheme in your program. Using a GetShape function, ask the user to select an item and ask for pertinent. If the data is valid call CalculateVolume and CalculateSurfaceArea.
*The tree overloaded volume and three overloaded surface area functions should all have the same name but different prototypes, depending on which shape property the function is calculating . For example, the overloaded Calculate volume function for a box has three inputs, whereas the sphere has only one.
*Use the overloaded function called WriteResult to report the calculate values for your shape. There will be three WriteResults function.
Explanation / Answer
DEAR FRIEND here is the program u want it took a lot of work from 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.