Question: Write a program to calculate the cost and time it takes to fill a swimming pool. Inputs: Length, Width, and Depth of the pool (This

Write a program to calculate the cost and time it takes to fill a swimming pool. Inputs: Length, Width, and Depth of the pool (This is a gross simplification, since pools are not really rectangular cubes.) Fill rate of the pool in Gallons per minute Calculation functions: o Write a function to calculate the total cubic feet (Length x Width x Depth) and return the cubic feet. Inputs: Length, Width, and Depth Return cubic feet o Write a function to calculate the number of gallons: 1 cubic foot = 7.48051948 US gallons (Create a constant to hold the conversion factor.) Input: Cubic Feet Return Gallons o Write a function to calculate the cost to fill the pool as follows: Calculate 1000s of gallons by dividing the total gallons by 1000 and putting the result in an integer variable. Use the following table to generate the cost: Input: Gallons Return Cost Call your functions from main() Outputs: o Total cubic feet o Total gallons o Cost o Time to fill in minute

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 Databases Questions!