Exercise 3.9Modify program P34_1.cpp to compute the side area, total area, and volume of a cylinder and thearea and volume of a sphere, depending on the choice that the user makes. Your program shouldask users to enter 1 to choose cylinder or 2 for sphere, and display an "invalid choice error" forother values.For a cylinder, we want to compute:Side area: (2*PI*r) * hTotal Area: 2*(PI*r2) + Side areaVolume: (PI*r2)*hFor a sphere, we want to compute:Surface area: 4*PI*r2Volume: (4.0/3.0)*PI*r3.Use overloading whenever possible.Call your new program Ex39.cpp.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here