Answer
See the detailed answer below.
Work Step by Step
a) The needed electric power is given by
$$P=\dfrac{W_{in}}{t}\tag 1$$
where $t$ is the time interval.
The heat pump works as a refrigerator that cools down the outside and warmth the inside. So the coefficient of performance for this heat pump is given by
$$K=\dfrac{Q_C}{W_{in}}$$
where $Q_C$ is the heat extracted from the cold reservoir.
Hence,
$$KW_{in}= Q_C \tag 2$$
And we know that $Q_H=Q_C+W_{in}$, so $Q_C=Q_H-W_{in}$
Plugging into (2);
$$KW_{in}= Q_H-W_{in} $$
Thus,
$$W_{in}(K+1)=Q_H$$
$$W_{in}=\dfrac{Q_H}{K+1}$$
Plugging into (1);
$$P=\dfrac{Q_H}{t}\cdot \dfrac{1}{K+1} $$
Noting that we already know $Q_H/t=15\;\rm kJ/s$
Plugging the known;
$$P=(15\times 10^3)\cdot \dfrac{1}{5+1} $$
$$P=\color{red}{\bf 2500}\;\rm W$$
---
b) The cost of using the electric heater in one month is given by
$${\rm Cost}_1=Pt\times {\rm Price}$$
$${\rm Cost}_1=\rm \dfrac{15000\;J}{1\;s}\times (200\;\times 60^2\;s)\times \dfrac{\$1}{40\times 10^6\; J}=\$\color{red}{\bf 270}$$
The cost of using the heat pump in one month is given by
$${\rm Cost}_2=Pt\times {\rm Price}$$
$${\rm Cost}_2=\rm \dfrac{2500\;J}{1\;s}\times (200\;\times 60^2\;s)\times \dfrac{\$1}{40\times 10^6\; J}=\$\color{red}{\bf 45}$$