i need help with the output because im getting most of the information but some of it doesnt make sense?i think two of my function are wrong addwater which is when i call it i get and error and the other one is drain water i dont think the formatting is right so anyone could help me please and thank you
test driver
your check in here says "if the pool isnt full, make it full".
it should be checking the pool isnt less than empty.
1 2
if (amountOfWaterInPool <0.0)
amountOfWaterInPool = 0.0;
addWater() is fine, "if the pool has more than maximum, set it to maximum"
1 2 3
if (amountOfWaterInPool > poolTotalWaterCapacity())
amountOfWaterInPool = poolTotalWaterCapacity();
It calls out to poolTotalWaterCapacity() which contains amountOfWaterInPool=(length * width * depth) *gallonsInCubicFoot; which is an assignment statement. whenever you call it it will set amountOfWaterInPool to be the maximum, even while you are still filling it.
the true maximum capacity is (length * width * depth) *gallonsInCubicFoot so just return that.
but when i output the data i get time needed to fill the pool 0
time need to fill the pool if it half full it should be 14 hours
amount of the water after an additional 3 hours is 33660 gallons
those three are the output im having trouble with
it should be
Time needed to fill the pool: 28 hours
Time needed to fill the pool if it is half full: 14 hours
Amount of water after adding water an additional 3 hours: 20431.5
You will need to make the changes before seeing better results.
but in short addWater() calls poolTotalWaterCapacity() which sets amountOfWaterInPool to be the pools max capacity (w*l*h*gallonsInCubicFoot)
so the very first call to addWater() will set amountOfWaterInPool to be the maximum. so fills the pool instantly.
error: no matching function for call to 'poool::addWater()'
candidate is:
void poool::addWater(double, double)
candidate expects 2 arguments, 0 provided
im sorry i keep asking question but now im getting an error again =[
""no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and 'void')|"" here the error
enter width
10
enter depth
10
enter the flow rate in
1
enter the flow rate out
1
enter the water in the pool (in gallons)
10
pool data
length: 10feet
width: 10 feet
depth: 10 feet
amount of water in pool : 10 gallons
fill rate : 1gal/hr
drain rate: 1gal/hr
water needed to fill the pool: 7470 gallons
time needed to fill the pool: 7470 hours
after filling pool to it capacity amount of water in pool: 7480
time needed to drain the pool completely: 10hours
amount of water left after draining half the pool: 5gallons
time need to fill the pool if it half full: 3735 hours
amount of water after adding water for additional 3 hours 13gallons
there is one mistake in there time need to fill the pool if it half full: 3735 hours
you will need to add a method to pool. timeToFillPoolFromEmpty()
Pool data:
Length: 30 feet
Width: 15 feet
Depth: 10 feet
Amount of water in pool: 0 gallons
Fill Rate: 20 gal/min
Drain Rate: 19.5 gal/min
Water needed to fill the pool: 33660 gallons
Time needed to fill the pool: 28 .05 hours
After filling pool to capacity, amount of water in pool is: 33660 gallons
Time needed to drain the pool completely: 0hours
Amount of water left after draining half the pool: 0gallons
Time needed to fill the pool if it is half full: 0hours
Amount of water after adding water an additional 3 hours: 60 gallons