Pyhon 3 Assignment Write a program to calculate the cost per cubic foot to compl
ID: 3592163 • Letter: P
Question
Pyhon 3 Assignment Write a program to calculate the cost per cubic foot to completely fill (to the top!) an above ground, round pool. Assume that the height of the pool is four feet. Accept from the user the diameter of the pool and the total cost of the water. Print the cost of the water per cubic foot. (Do not use data structures, functions, or Python statements we have not covered in class.) Test Case: Diameter 12 and water cost 500 --1.105 Use the following formula: 2 Volume of a cylinder: V- hExplanation / Answer
# Program to calculate the volume of the pool and cost of water per cubic foot given the total cost of water
PI = 3.14
diameter = float(input('Please Enter the diameter of pool: '))
height = 4 # height of pool = 4 feet
watercost = float(input(' Please Enter the water cost: '))
Volume = PI * diameter/2 * diameter/2 * height
print(" The Volume of a Pool = %.3f" %Volume)
cost = float((watercost/Volume ))
print(" Cost of water per cubic foot = %.3f" %cost)
Output:
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.