The given problem can be exemplified in the following diagram:
To determine the constant of the spring we can use Hook's law, which is the following:

Where:

Now, we solve for "k" by dividing both sides by the difference in length:

The force on the string is equivalent to the weight attached to it. The weight is given by:

Where:

Substituting in the formula for the constant of the spring we get:

Now, we substitute the values:
![\frac{(3kg)(9.8(m)/(s^2))}{35\operatorname{cm}-30\operatorname{cm}}=k]()
Before solving we need to convert the centimeters into meters. To do that we use the following conversion factor:
![100\operatorname{cm}=1m]()
Therefore, we get:
![\begin{gathered} 35\operatorname{cm}*\frac{1m}{100\operatorname{cm}}=0.35m \\ \\ 30\operatorname{cm}*\frac{1m}{100\operatorname{cm}}=0.30m \end{gathered}]()
Substituting in the formula we get:

Solving the operations:

Therefore, the constant of the spring is 588 N/m.