In Python A soup company is interested in finding out how much of their soup will go into various sized cans. The user will input the diameter of the can end, and the height of the can. The volume of a cylinder is the well known formula: volume = area of the ends * height of cylinder. The twist is that a can of soup can not be completely filled to the top; only 95% of the volume can be filled with soup; the remaining 5% must remain empty to allow for expansion. NOTE: when computing the area, use pi to at least 5 significant digits (eg, 3.14159) or use the constant math.pi. You should define a function named soup_volume which takes two parameters, the diameter of the can in cm, and the height of the can in cm, in that order. The function should return a float value, which is the volume of soup that the can is able to hold. The function should not round the value, but when printing the value in the main program, format it to show only 2 decimal places. Example run of the program: Enter the diameter of the can in cm: 5 Enter the height of the can in cm: 10  The can holds 186.53 cubic cm of soup. # Define your function here if __name__ == '__main__': d = float(input("Enter the diameter of the can in cm:\n")) # continue the rest of the program here

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter4: Control Structures I (selection)
Section: Chapter Questions
Problem 20PE: The cost of renting a room at a hotel is, say $100.00 per night. For special occasions, such as a...
icon
Related questions
Question

In Python

A soup company is interested in finding out how much of their soup will go into various sized cans. The user will input the diameter of the can end, and the height of the can. The volume of a cylinder is the well known formula: volume = area of the ends * height of cylinder. The twist is that a can of soup can not be completely filled to the top; only 95% of the volume can be filled with soup; the remaining 5% must remain empty to allow for expansion. NOTE: when computing the area, use pi to at least 5 significant digits (eg, 3.14159) or use the constant math.pi.

You should define a function named soup_volume which takes two parameters, the diameter of the can in cm, and the height of the can in cm, in that order. The function should return a float value, which is the volume of soup that the can is able to hold. The function should not round the value, but when printing the value in the main program, format it to show only 2 decimal places.

Example run of the program:

Enter the diameter of the can in cm:

5

Enter the height of the can in cm:

10 

The can holds 186.53 cubic cm of soup.

# Define your function here


if __name__ == '__main__':

d = float(input("Enter the diameter of the can in cm:\n"))
# continue the rest of the program here

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Constants and Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
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