As the spring is stretched, it exerts an upward restoring force <em>f</em>. At maximum extension, Newton's second law gives
∑ <em>F</em> = <em>f</em> - <em>mg</em> = 0 ==> <em>f</em> = (2.0 kg) (9.8 m/s²) = 19.6 N
By Hooke's law, if <em>k</em> is the spring constant, then
<em>f</em> = <em>kx</em> ==> <em>k</em> = <em>f</em>/<em>x</em> = (19.6 N) / (0.15 m) ≈ 130 N/m
A 4.0 kg mass would cause the spring to exert a force of
<em>f</em> = (4.0 kg) (9.8 m/s²) = 39.2 N
which would result in the spring stretching a distance <em>x</em> such that
39.2 N = (130 N/m) <em>x</em> ==> <em>x</em> = (39.2 N) / (130 N/m) ≈ 0.30 m ≈ 30 cm