Warning: Please follow the exact output format given in the examples. Otherwise
ID: 3629908 • Letter: W
Question
Warning: Please follow the exact output format given in the examples. Otherwise your program will not be graded by the system properly.A cylinder has a radius R and a length L. The volume, V, of the cylinder is given by the formula: V = PI×(R ^ 2)×L. The side surface area, S, of the cylinder is given by the formula: S = 2×PI×R×L. Write two C++ functions, "cylvol()" and "surfarea()" that both accept a cylinder's radius and length. The first one returns the volume and the second one returns the surface area.
Create a "main()" function that prompt for the radius and length, then invoke two functions to calculate the volume and surface area. The results should be in 4 floating point precision. Note you should use exact function names in your program.
Example 1:
Enter the cylinder's radius: 3
Enter the cylinder's length: 4.1
The volume of the cylinder is: 113.0940
The surface area of the cylinder is: 75.3960
Explanation / Answer
Dear Friend Here is the program u want PLEASE RATE #include #include using namespace std; const double PI = 3.06487804; double cylvol(double r,double len) { return(PI*(pow(r,2.0))*len); } double surfarea(double r,double len) { return(2*PI*r*len); } int main() { double r,len; coutr; coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.