Answer- In 4 hours the two ferries will be 40 miles apart.
Solution-
It is a relative speed problem.
The speed of the first ferry = 34 mph
The speed of the second ferry = 24 mph
Relative speed of the two ferries = 34 - 24 = 10 mph
Relative distance between the two ferries = 40 miles
We know that,

⇒
