Write a Program thatask the User to input the Radius and Length ofa Cylinder.
The Dimension must be in feet. The Algorithm must compute:

The Volume in Cubic Feet
The Surface Area in Inches
The Algorithm Will Display the Result.

Respuesta :

Answer:

#include <iostream>

using namespace std;

int main() {

   float radius,length,vol,area;//flioat variables to hold radius,length,volume and area.

   cout<<"Enter the radius and length of the cylinder respectively"<<endl;

   cin>>radius>>length;//taking input of radius and length..

   vol=3.14*radius*radius*length;//calculating volume..

   radius=radius*12;//converting radius from feet to inches..

   length=length*12;//converting area from feet to inches..

   area=2*3.14*radius*(length+radius);//calculating area..

   cout<<"Volume in cubic feet is ="<<vol<<endl<<"Area in square inches is ="<<area<<endl;//printing the output..

return 0;

}

Output:-

Enter the radius and length of the cylinder respectively

5 2

Volume in cubic feet is =157

Area in square inches is =31651.2

Explanation:

In the program above I have taken four float variables for storing radius,length,volume and surface area of the cylinder.Then calculating the volume and after that converting radius and length to inches and after that calculating area in square inches.

ACCESS MORE
EDU ACCESS