Question: Help me with this code! 1 . Given the diameter and the height, write a Python function named calculate _ cylinder _ volume to return

Help me with this code!
1. Given the diameter and the height, write a Python function named calculate_cylinder_volume to return (we solved very similar one in our last assignment but that time we didn't return a value. We printed it) the volume of the cylinder. The volume, v of a cylinder with diameter, d and height h is given by v=pi(d^2/4)h
2. Assume a soda can is a perfect cylinder. Write a Python function named count_soda_cans to return the number of soda cans of a given diameter and a given height that is required to be fully filled out of the given bulk volume amount of soda. Here you must use the function calculate_cylinder_volume you wrote above to calculate the volume of the soda can. Here is an example: assume the volume of a soda can calculated is 7.5 fluid ounce, and bulk soda volume is 1000 ounce, you require 133 soda cans to fully fill them with soda. The left over amount is 2.5 soda ounce. Mathematically 1000//7.5=133.0. Call calculate_cylinder_volume in your function.]
3. Write a Python function named calculate_revenue to calculate total sale price of a given amount of product of a given unit price. There is discount per item sold. The default discount amount is $0.00 per item sold. In your main program, calculate the revenues of selling 50 soda cans worth $1.20 each with no discount. Convert your value to an integer and print it. In your main program, calculate the revenues of selling 500 soda cans worth $1.20
The expected output of the full code is
84
14
165
60
549

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!