Answer
$k = 8.0~N/m$
Work Step by Step
When the force is exerted on the block, the block gains kinetic energy because the magnitude of the applied force is greater than the magnitude of the opposing force from the spring.
After passing $x=1~m$, the block loses kinetic energy because the magnitude of the applied force is less than the magnitude of the opposing force from the spring.
Thus, at $x=1~m$, the magnitude of the applied force is equal to the magnitude of the opposing force from the spring.
We can set up an equation:
$F = k~(1~m)$
$k = \frac{F}{1~m}$
We can use the kinetic energy at $d = 1~m$ to find the magnitude of $F$:
$K = F~d-\frac{1}{2}kd^2$
$K = F~d-\frac{1}{2}(\frac{F}{1~m})(d)^2$
$K = F~(1~m)-\frac{1}{2}(\frac{F}{1~m})(1~m)^2$
$K = F~(1~m)-\frac{1}{2}~F~(1~m)$
$K = \frac{1}{2}~F~(1~m)$
$F = \frac{2K}{1~m}$
$F = \frac{(2)(4.0~J)}{1~m}$
$F = 8.0~N$
We can find $k$:
$k = \frac{F}{1~m}$
$k = \frac{8.0~N}{1~m}$
$k = 8.0~N/m$