Answer
a) $152\;\rm J$
b) $-91.4\;\rm J$
Work Step by Step
The first process, from 1 to 2, is an isobaric process and the second process, from 2 to 3, is an isochoric process.
$\bullet\bullet$ From the given graph we can see that:
$\bullet$ $T_1=T_3=100^\circ\rm C=373\;K$
$\bullet$ $P_1=P_2= 3\;\rm atm$
$\bullet$ $P_3= 1\;\rm atm$
$\bullet$ $V_2=V_3= 300\;\rm cm^3$
$\bullet$ $V_1 =100\;\rm cm^3$
So that the only unknown here is $T_2$ and $n$.
$T_2$ is given from the first process:
$$\dfrac{ \color{red}{\bf\not} P_1V_1}{T_1}=\dfrac{ \color{red}{\bf\not} P_2V_2}{T_2}$$
Hence,
$$T_2=\dfrac{T_1V_2}{V_1}=\dfrac{(373)(300)}{(100)}=\bf 1119\;\rm K$$
$\bullet$ $T_2= 1119\;K$
Now the number of moles $n$ can be found by using the first process at point 1:
$$P_1V_1=nRT_1$$
Hence,
$$n=\dfrac{P_1V_1}{RT_1}=\dfrac{(3\times 1.013\times 10^5)(100\times 10^{-6})}{(8.31)(373)}=\bf 0.0098044\;\rm mol$$
$\bullet$ $n= 9.8044\times 10^{-3}\;mol$
____________________________________________________________
a) For an isobaric process, the heat needed is given by
$$Q_{1\rightarrow2}=nC_{\rm p}(T_2-T_1)$$
Plugging the known;
$$Q_{1\rightarrow2}=( 9.8044\times 10^{-3})(20.8)(1119-373)$$
$$Q_{1\rightarrow2}=\color{red}{\bf 152}\;\rm J$$
---
b) For an isochoric process, the heat needed is given by
$$Q_{2\rightarrow3}=nC_{\rm v}(T_3-T_2)$$
Plugging the known;
$$Q_{2\rightarrow3}=( 9.8044\times 10^{-3})(12.5)(373-1119 )$$
$$Q_{2\rightarrow3}=\color{red}{\bf -91.4}\;\rm J$$