Practice · 3 of 3
override catches the bug
CHALLENGE
Difficulty: intermediate+25 XP
Implement class Sensor with virtual std::string reading() const returning "base", and class TempSensor : public Sensor overriding it to return "22C". The signature must match exactly (const included) and the override must use the override keyword.
Press Submit to check your solution.
Back to lesson: Practice: Polymorphism and the virtual destructor rule