so i made this program recently i am stuck and need help it
Write the definition of a class, swimmingPool, to implement the properties of a swimming pool. Your class should have the instance variables to store the length (in feet), width (in feet), depth (in feet), the rate (in gallons per minute) at which the water is filling the pool, and the rate (in gallons per minute) at which the water is draining from the pool. Add appropriate constructors to initialize the instance variables. Also add member functions to do the following: determine the amount of water needed to fill an empty or partially filled pool, determine the time needed to completely or partially fill or empty the pool, and add or drain water for a specific amount of time.
The UML diagram and header file are supplied.
Write the class implementation file. Write a test program for your class. Your test program should produce the following output:
my question is i have most of the program done but my addwater and drainwater function are completely wrong im lost on how to fix them i need some adavance
I recommend you do your calculation before the if() statements, break the calculation into the individual parts so you can print each par to the calculation to help determine the cause of the problem. Do the same with the calculations in the bodies of your if() statements. Then you may be able to determine if your calculation is correct. For example is (time * rate) actually in gallons per minute? Do you really want to use the total capacity figure in these calculations? Shouldn't you have some kind of information about the amount of water in the pool?