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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started