Answer
The work done by the spring on the block is $~~-14.4~J$
Work Step by Step
When $x = 2.0~cm,$ the spring force is $-160.0~N$
We can find the spring constant $k$:
$F = -kx$
$k = -\frac{F}{x}$
$k = -\frac{-160.0~N}{0.020~m}$
$k = 8000~N/m$
We can find the work done by the spring on the block as the block moves from $x_i = +8.0~cm$ to $x_f = -10.0~cm$:
$W = \frac{1}{2}kx_i^2-\frac{1}{2}kx_f^2$
$W = \frac{1}{2}k~(x_i^2-x_f^2)$
$W = \frac{1}{2}(8000~N/m)~[(0.080~m)^2-(-0.100~m)^2)]$
$W = \frac{1}{2}(8000~N/m)~(-0.0036~m^2)$
$W = -14.4~J$
The work done by the spring on the block is $~~-14.4~J$.