Answer
The work done by the spring on the block is $~~15.6~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 = +5.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.050~m)^2)]$
$W = \frac{1}{2}(8000~N/m)~(0.0039~m^2)$
$W = 15.6~J$
The work done by the spring on the block is $~~15.6~J$.