A block of mass M=6 kg and initial velocity v=0.8m/s slides on a frictionless horizontal surface and collides with a relaxed spring of unknown spring constant. The other end of the spring is attached to a wall. If the maximum compression of the spring is 0.2 m, what is the spring constant?

4 answers

Equate kinetic and potential (spring) energies:
KE=(1/2)mv²
PE=(1/2)ks²
Solve for k
k=mv²/s² N/m
(verify that quantities are in consistent units).
I tried
F=-kx so
mg=-kx
(6 kg)(9.8m/s^2)=-k(0.2m)
k= 294 N/m

But the correct answer is supposed to be 96 Nm.
Oh I see now. Thanks!
You're welcome!