a) - c)
Resolve each force from the positive $x$-direction (pointing to the right). For the force $P$ this is at $90^{ \circ}$ to the $x$-axis therefore has a contribution of $P \times \cos 90^{\circ} = 0$ to the sum of components.
The force $F$ is at $(180-\var{theta1})^{\circ}=\var{90 + 90 - theta1}^{\circ}$ to the positive $x$-direction therefore has a contribution of $F \times \cos \var{180-theta1}^{\circ} = \var{force1} \times \cos \var{180-theta1}^{\circ} = \var{precround(force1*cos(radians(180-theta1)),3)}$ to the sum of components. This will be negative as you can imagine if you were moving in the positive $x$-direction this force is acting in the opposite direction and pulling you back!
The force $Q$ is at $\var{theta2}^{\circ}$ to the positive $x$-direction therefore has a contribution of $Q \times cos \var{theta2}^{\circ} = \var{force3} \times \cos\var{theta2}^{\circ} = \var{precround(force3*cos(radians(theta2)),3)}$. This is positive as it is acting in the same direction as the positive.
Therefore the sum of components in the $x$-direction is $0 - \var{precround(-force1*cos(radians(180-theta1)),3)} + \var{precround(force3*cos(radians(theta2)),3)} = \var{precround(force1*cos(radians(180-theta1)) + force3*cos(radians(theta2)),3)}$.
d) - g)
Resolve each force from the positive $y$-direction (upwards). For the force $P$ this is acting completely in the positive direction, at no angle. Therefore it's contribution is $\var{force2}$. Note that this is the same as $\var{force2} \times \cos 0^{\circ}$.
The force $F$ is at $(90 - \var{theta1})^{\circ} = \var{90 - theta1}^{\circ}$ to the positive $y$-direction therefore has a contribution of $F \times \cos \var{90 - theta1}^{\circ} = \var{force1} \times \cos \var{90 - theta1}^{\circ} = \var{precround(force1*cos(radians(90-theta1)),3)}$ to the sum of components. This is positive as it is acting in the same direction to the positive.
The force $Q$ is at $(90+\var{theta2})^{\circ}=\var{90 + theta2}^{\circ}$ to the positive $y$-direction therefore has a contribution of $Q \times \cos \var{90 + theta2}^{\circ} = \var{force3} \times \cos \var{90 + theta2}^{\circ} = \var{precround(force3*cos(radians(90+theta2)),3)}$ to the sum of components. This is negative as it is acting downwards, in the opposite direction to the positive.
Therefore the sum of components in the $y$-direction is $\var{force2} + \var{precround(force1*cos(radians(90-theta1)),3)} - \var{-precround(force3*cos(radians(90+theta2)),3)} = \var{precround(force2 + force1*cos(radians(90-theta1)) + force3*cos(radians(90+theta2)),3)}$.