Skip to main content

Practice · 1 of 1

Temperature Class

CHALLENGE
Difficulty: beginner+25 XP

Implement class Temperature (Celsius): constructor validates -273.15..10000 (invalid → keeps 0.0); set(double) same rule; celsius() const; is_freezing() const (<= 0).

Back to lesson: Practice: Class Practice: Invariants That Hold