Originally Posted by
CommonTater
Then switch your while loop to administer on the number of baloons thrown... not the amount of water in the pool... interestingly you are already incrementing that variable at the bottom of the loop... just use it.
Ok... a little more debugging... the problem is that distanceTraveled never hits *exactly* 35... a small modification to allow anything from 35.0 to 35.99999 solved the problem...
Code:
if((int) distanceTraveled ==35)
{
poolWater=poolWater+balloonWater;
balloonNumHit++;
}
and here's the output...
I'm thinking you can clean the rest of this up yourself???