aspose file tools*
The moose likes Programming Diversions and the fly likes Bad current.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Other » Programming Diversions
Bookmark "Bad current...." Watch "Bad current...." New topic
Author

Bad current....

HS Thomas
Ranch Hand

Joined: May 15, 2002
Posts: 3404
Oh no! Buzzy's powerboat is caught in the current and is being sucked towards the waterfall. The boat can run at 16mph but the current is pulling him towards the falls at 9mph. Buzzy's motor uses 5 gallons of gas an hour , he has 16 gallons left and the first safe anding is 21 miles back up river. Will he make it ?
regards
Mani Ram
Ranch Hand

Joined: Mar 11, 2002
Posts: 1140
He can make it.


Mani
Quaerendo Invenietis
HS Thomas
Ranch Hand

Joined: May 15, 2002
Posts: 3404
Oh I forgot to write the question "How?"

regards
Mani Ram
Ranch Hand

Joined: Mar 11, 2002
Posts: 1140
Originally posted by HS Thomas:
Oh I forgot to write the question "How?"
regards


Wanted to be the first to answer the question...thatz why
Here is the solution.
He can sail at a speed of 7 mph (16 - 9).
At this speed, it will take him 3 hours to reach the safe landing ares (21/7).
So, to travel for 3 hours, he needs 15 gallons (3X5) and he has an extra gallon to spare.
Thus he can make it and donate the remaining gallon to me
[ October 24, 2003: Message edited by: Mani Ram ]
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11231
    
  16

i must be missing something.
if he heads straight upstream, at 16 mph, and the current is pulling him back at 9mph, his effective speed is 7mph (relative to the shore).
he has 16 gallons of fuel, being burned at 5 gallons/hour. this give him 3 hours and 12 minutes to travel upstream. that should allow him to go 22.4 miles, plenty far enough to make the landing...
what am i missing?


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
HS Thomas
Ranch Hand

Joined: May 15, 2002
Posts: 3404
what am i missing?

I don't think you are missing anything. The safe landing is 21 miles upstream as indicated in the question. You just calculated Buzzy has enough fuel to land 22.4 miles back up river.
both of you
regards
Dan Lastoria
Ranch Hand

Joined: Jan 30, 2002
Posts: 57
So what's the catch? Or is that it?
HS Thomas
Ranch Hand

Joined: May 15, 2002
Posts: 3404
That's it. Do you think there should be more ?
Perhaps, if you are going against the current in a power boat I am not sure if the drift (or drag) is a simple substraction.
But that was the answer given.

regards
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Bad current....