Let's denote the rate of the boat in still water by "b" and the rate of the current by "c".
When the boat is traveling upstream (against the current), its effective speed is b - c. When it is traveling downstream (with the current), its effective speed is b + c.
We can use the following two equations based on the distance, speed and time relationship:
1. Distance = Speed x Time
2. Speed = Distance / Time
Using these equations, we can write two equations based on the given information:
1. (b - c) x 5 = 315 (Upstream journey)
2. (b + c) x 7 = 623 (Downstream journey)
Simplifying these equations, we get:
1. 5b - 5c = 315
2. 7b + 7c = 623
Dividing both sides of equation 1 by 5, we get:
b - c = 63
Adding equation 1 and equation 2, we get:
12b = 938
Dividing both sides by 12, we get:
b = 78.17 km/h
Substituting b = 78.17 in equation 1, we get:
78.17 - c = 63
Solving for c, we get:
c = 15.17 km/h
Therefore, the rate of the boat in still water is 78.17 km/h and the rate of the current is 15.17 km/h.