A 2.1 kg block slides with a speed of 1.1 m/s on a frictionless, horizontal surface until it encounters a spring.

(a) If the block compresses the spring 5.7 cm before coming to rest, what is the force constant of the spring?

(b) What initial speed should the block have to compress the spring by 1.8 cm?

What I'm having trouble with is finding the force acting on the spring. I believe that with that I can find the force constant. (Correct me if I'm wrong) How can I find the force acting on the force as applied by the block?