Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions

Question

Do you think you have a true calling?

Answered: 1 week ago