A 500-gram mass is attached to a spring and executes simple harmonic motion with a period of 0.25 second. If the total energy of the system is 4J, find the force constant of the spring?