# Unit 3 – Basic Demo: Temperature Sensor

Weather stations and smart buildings use sensors to monitor temperature 
continuously. This demo models a temperature sensor that records readings 
and tracks the coldest and warmest values seen so far.

## Setting up

1. Compile `TemperatureSensor`.
2. Create a sensor: `TemperatureSensor("Greenhouse")`.
3. Call `rangeReport()` — the sensor starts at a default temperature 
   of 20.0°C.

## Experimenting

4. Call `measure(35.0)` — watch the message printed. Call 
   `rangeReport()` — the max has updated.
5. Call `measure(-3.0)` — now the min has dropped too. Call 
   `rangeReport()` again.
6. Call `printCategory()` — the label reflects the last reading recorded.
7. Call `measure(18.0)`, then `printCategory()` again — the category 
   changes with the reading.
8. Create a second sensor: `TemperatureSensor("Freezer")`. Take different 
   readings on each and call `rangeReport()` on both — each sensor tracks 
   its own range independently.

## What to look at in the code

9. Open TemperatureSensor and find `measure()`. It contains two `if` 
   statements: each one checks a condition and updates a property as a 
   side effect. Neither one produces a value.
10. Find `printCategory()`. The `when` here has no value after the 
    keyword — each branch tests its own full condition. It prints a 
    label directly and returns nothing.
11. Notice the ranges in `printCategory()`: `temperature in 0.0..9.9`
    checks whether the value falls between two numbers. The branches are
    ordered from coldest to warmest, so the first matching one wins.
