File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programming Diversions and the fly likes Time, speed and distance travelled Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Other » Programming Diversions
Bookmark "Time, speed and distance travelled" Watch "Time, speed and distance travelled" New topic

Time, speed and distance travelled

kayal cox
Ranch Hand

Joined: Aug 19, 2004
Posts: 376
I am helping my younger brother prep for aptitude tests.
I have below a question for which I was able to get at the answer, but I am not sure if my approach is the fastest or the best.
All he has is about 50 secs to work it out, but it took me more than that to get at the accurate answer.

A person who decided to go on a weekend trip should not exceed 8 hrs of travel time.

The average speed of the forward journey is 40mph.
Traffic causes the average speed of the return journey to drop to 30mph.

How far can he select a picninc spot?

Please let me know what is the answer and what method you used to arrive at it. Thanks.
Ryan McGuire
Ranch Hand

Joined: Feb 18, 2005
Posts: 1044
On my mark, get set, GO!

Ok, it took me 48 seconds to come up with this (including the long division and transferring the final decimal answer to the bottom of the page):

X is the distance from home to the picnic area.
X/40 = travel time going out.
X/30 = travel time returning.
X/40 + X/30 <= 8
3X/120 + 4X/120 <= 8
7X/120 <= 8
7X <= 960
X <= 137 1/7 miles or 137.(142857) miles, however you want it expressed.

All units are in miles, hours, or miles per hour, whichever is appropriate.
kayal cox
Ranch Hand

Joined: Aug 19, 2004
Posts: 376
Perfect! Thanks
Ranch Hand

Joined: Mar 15, 2005
Posts: 41
Hi Kayal cox,

r u from kayal in south India?
Mohd Ali Advani
Ranch Hand

Joined: Apr 14, 2005
Posts: 54
Sabeer this is programming diversion forum and not about asking geographical region of the poster.You can PM her about knowing latitude/longitude of her location.
I agree. Here's the link:
subject: Time, speed and distance travelled
It's not a secret anymore!