#ifndef myCounterHPP #define myCounterHPP class MyCounter { protected: int counter; int max; public: explicit MyCounter(int theMaxValue) : counter(0), max(theMaxValue) {} MyCounter(int theCounter, int theMaxValue) : counter(theCounter), max(theMaxValue) {} int getCounter() const { return counter; } int getMax() const { return max; } void increment() { counter++; if (counter > max) counter = 0; } void reset() { counter = 0; } }; #endif