If a spring has a constant of 12 (kg)/s^2, how much work will it take to extend the spring by 45 cm ?

$W = \frac{12 \times {0.45}^{2}}{2}$[J]
$\mathrm{dw} = K x \mathrm{dx}$ and the total work done during the elongation is given by
$W = {\int}_{0}^{\Delta} K x \mathrm{dx} = \frac{1}{2} K {\Delta}^{2} = \frac{12 \times {0.45}^{2}}{2}$[J]