28.4 miles.
This problem effectively creates a triangle with the data you're giving being SAS (side, angle, side) and then asks you for the length of the 3rd side. So let's first determine the sides and angle of the triangle.
1st side, the ship leaves at 1 pm and travels for 4 - 1 = 3 hours at 12 mph. So the length of the side is 12 * 3 = 36 miles.
2nd side, the ship leaves at 2 pm and travels for 4-2 = 2 hours at 15 mph. So the length of the side is 15 * 2 = 30 miles
The included angle. The key thing to realize is that the angle isn't either of the ship headings. It's the difference between the headings. So we have one ship with a heading of 70 degrees and the other ship with a heading of 120 degrees. So there's a difference of 120 - 70 = 50 degrees between the two ships.
So we have side 1 = 36 miles, side 2 = 30 miles, included angle = 50 degrees.
Since we we only know the lengths of the adjacent sides to the known angle, we should use the law of cosines to solve for the unknown side (if we had a known angle and knew the length of the opposite side to the angle, we would use the law of sines).
The law of cosines is:
c^2 = a^2 + b^2 - 2ab cos θ
where a,b = adjacent sides to known angle
c = side opposite to known angle
θ = known angle
Let's substitute the known values and calculate
c^2 = a^2 + b^2 - 2ab cos θ
c^2 = 36^2 + 30^2 - 2*36*30 cos 50
c^2 = 1296 + 900 - 2160*0.64278761
c^2 = 1296 + 900 - 1388.421237
c^2 = 807.5787631
c = 28.41793031
So at 4 pm, the distance between the ships is 28.4 miles.