Answer
a) $1.03\times10^3\;\rm J$
b) $1.03\times10^3\;\rm J$
c) $231\;\rm J$, $389\;\rm J$
Work Step by Step
a)
We know that the coefficient of performance for a heat pump is given by
$${\rm COP} =\dfrac{Q_H}{W}$$
solving for the work done by the pump $W$;
$$W=\dfrac{Q_H}{{\rm COP}} $$
Plugging the known;
$$W=\dfrac{3100}{3} =\color{red}{\bf 1.03\times10^3}\;\rm J$$
b)
As we see in part (a), the work does not depend, in this case, on the outdoor temperature.
Thus, we got the same work here as well.
$$W =\color{red}{\bf 1.03\times10^3}\;\rm J$$
c)
The author here asks us to answer the two questions (a) and (b) again but by assuming that we have an ideal coefficient of performance (Carnot).
We know that the efficiency of an engine is given by
$$e=\dfrac{W}{Q_H}$$
and we know that Carnot's ideal efficiency is given by
$$e=\dfrac{T_H-T_L}{T_H}$$
From the last two formulas;
$$\dfrac{W}{Q_H}=\dfrac{T_H-T_L}{T_H}$$
And hence, the work is given by
$$ W =\dfrac{T_H-T_L}{T_H}\cdot Q_H$$
Plugging the given and remember to convert the temperatures to Kelvin.
For the first case:
$$ W_a =\dfrac{295-273}{295}\cdot 3100=\color{red}{\bf 231}\;\rm J$$
For the second case:
$$ W_b =\dfrac{295-258}{295}\cdot 3100=\color{red}{\bf 389}\;\rm J$$