They have given you more information than you need. Since they tell you the spring constant (k) and deflection (X), you don't need the weight (Mg) or mass, (M)
E = (1/2) k X^2 = (1/2)*30*(0.5)^2
= 3.75 Joules
When a 1.53-kilogram mass is placed on a spring
with a spring constant of 30.0 newtons per meter,
the spring is compressed 0.500 meter. How
much energy is stored in the spring?
1 answer