The weigth of the mass placed on top of the spring provides the force that compresses it:
[tex]F=mg[/tex]
where m is the mass and g is the gravitational acceleration.
For Hook's law, the compression [tex]\Delta x[/tex] of the spring is related to the force applied by
[tex]F=k \Delta x[/tex]
where k is the spring constant. Using [tex]\Delta x= 15 cm= 0.15 m[/tex] and k=200 N/m, we can equalize the two forces to find the mass m:
[tex]mg=k \Delta x[/tex]
[tex]m= \frac{k \Delta x}{g}= \frac{(2000 N/m)(0.15 m)}{9.81 m/s^2}=30.6 kg [/tex]