The volume and area of a cylinder are calculated as: Volume = πr2h Area = 2πrh + 2πr2 Given the radius and height of a cylinder as floating-point numbers, output the volume and area of the cylinder. Hint: Use the built-in pow() function and the constant pi from the math module in your calculations. Output each floating-point value with one digit after the decimal point, which can be achieved as follows: print('Volume: {:.1f} cubic inches'.format(yourValue)). Ex: If the input is: 5.2 8.1 where 5.2 is the radius of the cylinder and 8.1 is the height of the cylinder, then the output is: Volume: 688.1 cubic inches Surface area: 434.5 square inches

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter2: Using Data
Section: Chapter Questions
Problem 15E: Write a program named FahrenheitToCelsius that accepts a temperature in Fahrenheit from a user and...
icon
Related questions
Question

The volume and area of a cylinder are calculated as:

  • Volume = πr2h
  • Area = 2πrh + 2πr2

Given the radius and height of a cylinder as floating-point numbers, output the volume and area of the cylinder.

Hint: Use the built-in pow() function and the constant pi from the math module in your calculations.

Output each floating-point value with one digit after the decimal point, which can be achieved as follows:
print('Volume: {:.1f} cubic inches'.format(yourValue)).

Ex: If the input is:

5.2 8.1

where 5.2 is the radius of the cylinder and 8.1 is the height of the cylinder, then the output is:

Volume: 688.1 cubic inches

Surface area: 434.5 square inches

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage