Practice · 1 of 1
A const-correct thermometer
Implement struct Thermometer with a private double celsius_{0.0};, void set(double c) storing the value, double celsius() const returning it, and double fahrenheit() const returning celsius() * 9.0 / 5.0 + 32.0. Both getters must be const.
Difficulty: intermediate
Press Submit to check your solution.
Back to lesson: Practice: Design a const-correct type