Question
Write a program that calculates the area and volume of a cylinder. Radius and height must be entered by the user. The area of a
Write a program that calculates the area and volume of a cylinder. Radius and height must be entered by the user. The area of a cylinder is 2 times base area added to the area of the side surface. The area of the side surface is multiplication of base circumference and height. The volume of a cylinder is base area multiplied by the height. You may assume PI is 3.14.
Steps:
Define two double variables radius and height and prompt the user to enter values for it.
Define two double variables area and volume and calculate the values and store in these variables.
Print the values of area and volume on the screen.
Sample output:
Enter radius and height of the cylinder: 2.5 3.5
Area: 94.2
Volume: 68.6875
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