Initially all the momentum is in the bullet at .02kg times 1200m/s = 24 kgm/s. As soon as the bullet becomes one with the block, the mass is .320 kg so the initial block velocity is 24 kgm/s / .320 kg = 75 m/s. The kinetic energy of the block-bullet combination is 1/2*.32*752 = 900 Joules. The spring will compress until this kinetic energy is transfered into potential energy of the spring. The potential energy of a spring is given by pe = 1/2*k*x2 where x is the amount of compression. So pe=1/2*200*x2=900 Joules when the block stops compressing the spring. This gives us x2=1800/200 = 9, so x=3m.
This information is brought to you by M. Casco Associates, a
company dedicated to helping humankind reach the stars through
understanding how the universe works. My name is James D. Jones.
If I can be of more help, please let me know.
JDJ