Bobby - use the formula velocity = distance / time
Next, solve for time = distance / velocity. Why? Because the time it takes the cars to travel 150 and 350 is the same, so you can set the two equations equal to each other.
That is, 150/v = 350 / (v+40).
Now just solve for v, the speed of the slower car, then add 40 to that answer to get the speed of the faster car.
Hope that helps