0.15 m
0.12 m
1.5 m
0.5 m
At the maximum compression, the whole of the kinetic energy of the body would be transformed to the elastic potential energy of the spring.
⟹ 1/2mv² = 1/2kx²max
⟹ xmax = √(mv²/k) = √((5 kg)(1.5 m/s)²/(5 N/m)) = √(1.5² m²/s²) = 1.5 m