Answered step by step
Verified Expert Solution
Question
1 Approved Answer
this is a C++. use visual studios 3) Calculate the volume of a water bottle shown below. The bottle is made up of 2 sections,
this is a C++. use visual studios
3) Calculate the volume of a water bottle shown below. The bottle is made up of 2 sections, a cylindrical piece and a spherical piece. Define PI as a constant using one of the methods mentioned in class and use appropriate math library functions when performing calculations Prompt the user for the radius of the spherical portion and the radius and height of the cylindrical portion. Calculate volumes of the spherical portion, the cylindrical portion, and the total volume of the bottle. Use the following formulas: Volume of cylinder: V(cyl)- rh Volume of sphere: V(sph) =-m2 Print the individual volumes of the cylinder and spherical parts of the water as well as the total volume of the water bottle. Print your answers to 4 decimal places. Test with values t(sphere)-5 , r(sn-2 cm, and h = 8 cm. height usphere)
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