Answer
$Q=568.0\ kJ$, flowing out of the system.
Work Step by Step
Energy balance for the system:
$Q-W_b=\Delta U=mc_v(T_3-T_1)$
For an ideal gas:
$PV=mRT$
Plugging in the initial state values ($P_1=600\ kPa, V_1=0.8\ m³,\ R=0.287\ kJ/kg.K,\ T=1200\ K$):
And solving for the mass: $m = 1.39\ kg$
Initial constant-temperature process:
$W_{b,1-2}=mRT_1\ln(\frac{P_1}{P_2})$
Final constant-volume process:
$W_{b,2-3}=0$
With $P_2=300\ kPa$:
$W_b=332.8\ kJ$
With $c_v=0.718\ kJ/kg.K$
$\Delta U=-900.8\ kJ$
Therefore:
$Q=-568.0\ kJ$