Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts Of Database Management

Authors: Joy L. Starks, Philip J. Pratt, Mary Z. Last

9th Edition

1337093424, 978-1337093422

More Books

Students also viewed these Databases questions