You may want to review (Pages 212 - 217).
For related problemsolving tips and strategies, you may want to view a Video Tutor Solution of Motion with gravitational, elastic, and friction forces.
How far must the spring be compressed for an amount 3.40 J of potential energy to be stored in it?
You place the spring vertically with one end on the floor. You then drop a book of mass 1.40 kg onto it from a height of 0.800 m above the top of the spring. Find the maximum distance the spring will be compressed.