Answer:
k = 40 N/m
Step-by-step explanation:
A spring's energy is given:
![U = 0.5kx^2](https://img.qammunity.org/2020/formulas/physics/high-school/nuwj8ep7cotdf4a4sfbjfxlrwzjatvylb4.png)
U is the energy in the spring, k is the spring constant and x is the spring displacement.
We are told that the spring stores 5J of energy, therefore, U = 5J. We are also told that the spring is compressed by 0.5m, so the spring x = 0.5m
![5 J = 0.5k(0.5m)^2\\5J = 0.5k(0.25m^2)\\5J = k*(0.125)m^2\\\\k = 5J/(0.125)m^2\\k = 40 N/m](https://img.qammunity.org/2020/formulas/physics/high-school/ouxf9y5ty3usownf2pe2eobm7ubun0h5pq.png)
k = 40 N/m
Hope this helps!