Switching in response to temperature

As part of a larger project , I want to read the temperature from a thermister, and operate a relay in response.

The complication is, when the temperate reaches minus 30 deg. C, the relay energises. The relay remains energised until the temperature reaches plus 2 deg C, at which point the relay de-energises. Then the temperature starts dropping again until it reaches minus 30 deg C, etc.

Is it possible to do this with, say, a Uno, and how would the script look? Thanks.

void loop()
{
  float temp = read_temperature() ;
  if (temp <= -30.0)
    energize_relay() ;
  else if (temp >= +2.0)
    deenergize_relay() ;
}

Then you have to figure out the details of talking to particular sensor and relay...

Thank you, that's helpful.