Because all the examples are vectors please make sure that you state values and coordinates/direction
There are a few ways that we can tackle the problems of relative velocity. The most important thing to do is work out whether or not the observer is stationary or moving. We will start with a simple example of a stationary observer looking at a plane.
As you can see this is a simple vector addition in one dimension. Both the plane's engine and the wind contribute to the speed that a stationary observer on the ground may observe.
When a cross wind is the 2nd contributor, a vector addition needs to be done. Make sure your either use Pythagoras or accurate drawing to ensure that you obtain your solution.
In this case where a boat is crossing a river we are assuming that the observer is on the shore. This is no different that the above example. However there is another factor to consider. Does the current affect the velocity that the boat is travelling across the river?
The answer is no. Therefore if asked to calculate the time to cross a river you use only the velocity of the boat contributes, not the river velocity and not the resultant velocity of the boat. This comes up in many questions so be careful.
When considering a moving observer, the calculation is :
V(rel) = V(object) - V(observer)
If the observer is in car A The the calculation is 40 - 30 = 10ms-1. That is the observer is moving at 10ms-1 to the right relative to car B.
In this case, lets say the observer is in the red car. Because the green car is travelling in the opposite direction relative to the observer, and velocity is a vector quantity, we assign it a negative value. The calculation is below.
This also works for motion in 2 dimensions as well. Just be careful to remember it is a vector subtraction not an addition.