Typically with these kinds of questions you want to start by drawing a diagram. Here I'll draw the diagram out for you, but I'd encourage you to post your own attempt with the diagram for any future questions.
(Note: I tried to make my diagram to scale, but this wouldn't be required in an exam. So long as your picture helps illustrate your point, and subsequent calculations are valid and correct, you shouldn't be penalised for this issue.)
Here, \(N_1\), \(N_2\) and \(N_3\) are just points to help denote the northerly direction. \(P\), \(Q\) and \(R\) denote Maria's initial position, position after the NW journey and position after the subsequent NE journey respectively.
The distance we require is denoted by \(x\). As hinted in the title, since there are 2 sides known and we require the third side, the cosine rule makes more sense. Which means we'd require the angle
opposite the side \(x\). But the only ingredients we have for this problem are the bearings.
So we need to think about how we can get that angle. This usually requires properties of parallel lines, working with the northerly directions. Here,
co-interior angles are useful, because it connects the angles at \(P\) and \(Q\) together. We see that \( \angle N_1 P Q + \angle P Q N_2 = 180^\circ\), so \( \angle P Q N_2 = 112^\circ\).
But the angle of use to us is \(\angle PQR\), because we wish to stay in the triangle. So we just have to compare the angles we have on the diagram.
\begin{align*}
\angle PQR &= \angle PQN_2 - \angle RQN_2\\
&= 112^\circ - 34^\circ\\
&= 78^\circ.
\end{align*}
And now there's enough information to apply the cosine rule.
\begin{align*}
x^2 &= 7^2 + 12^2 - 2\times7\times12\times\cos 78^\circ\\
x &= \sqrt{49+144-168\cos78^\circ}\\
x &= \sqrt{193 - 168\cos 78^\circ}.
\end{align*}
You can use your calculator to get an approximate decimal value for that expression.
Now I'll let you try to finish the question off, but I'll start b) off for you. Note that because we want the bearing of the starting point from the finishing point, what we require is the angle \(\theta\) in this diagram:
However because you can only work using \(\triangle PQR\), you have to start by finding \(\angle QRP\), denoted by \(\phi\) in this diagram. This will now require you to use the
sine rule - think about why! Use that to gradually build up to finding what \(\theta\), i.e. what \(\angle PRN_3\) is.
Remark: At first glance, I cannot find any easy way to compute \(\angle QPR\). So you may need to use \(\angle RQP\) and the corresponding value of \(x\) from part a) instead.
Please post if you have any further issues and where they are.