Thermometer classes example in C++