Answer
a) $-1013\;\rm J$
b) $1417 \;\rm J$
Work Step by Step
We can see that process A is an isochoric process.
Thus,
$$Q_A=nC_{\rm v}(T_f-T_i)\tag 1$$
So we need to find $T_i$ and $T_f$ of this process.
We assume that nitrogen gas is an ideal gas, so
$$P_iV_i=nRT_i$$
Hence,
$$T_i=\dfrac{P_iV_i}{nR}$$
Plugging the known; (see the given graph)
$$T_i=\dfrac{(3\times 1.013\times 10^5)(2000\times 10^{-6})}{(0.1)(8.31)}=\bf 731\;\rm K$$
By the same approach;
$$T_f=\dfrac{P_fV_f}{nR}$$
Plugging the known; (see the given graph)
$$T_f=\dfrac{(1\times 1.013\times 10^5)(2000\times 10^{-6})}{(0.1)(8.31)}=\bf 244\;\rm K$$
Plugging these two temperatures into (1);
$$Q_A=(0.1)(20.8)(244-731) =\color{red}{\bf -1013}\;\rm J$$
---
We can see that process B is an isobaric process.
Thus,
$$Q_B=nC_{\rm p}(T_f-T_i)\tag 2$$
So we need to find $T_i$ and $T_f$ of this process.
$$T_i=\dfrac{P_iV_i}{nR}$$
Plugging the known; (see the given graph)
$$T_i=\dfrac{(2\times 1.013\times 10^5)(1000\times 10^{-6})}{(0.1)(8.31)}=\bf 244\;\rm K$$
By the same approach;
$$T_f=\dfrac{P_fV_f}{nR}$$
Plugging the known; (see the given graph)
$$T_f=\dfrac{(2\times 1.013\times 10^5)(3000\times 10^{-6})}{(0.1)(8.31)}=\bf 731\;\rm K$$
Plugging these two temperatures into (2);
$$Q_B=(0.1)(29.1)(731-244) =\color{red}{\bf 1417}\;\rm J$$