#ifndef forwardCounterHPP #define forwardCounterHPP #include"BaseCounter.hpp" class ForwardCounter : public BaseCounter { public: explicit ForwardCounter(int theMaxValue) : BaseCounter(theMaxValue) {} ForwardCounter(int theCounter, int theMaxValue) : BaseCounter(theCounter, theMaxValue) {} void increment() { counter = counter < max ? counter +1 : 0; } }; class BackwardCounter: public BaseCounter { public: explicit BackwardCounter(int theMaxValue) : BaseCounter(theMaxValue) {} BackwardCounter(int theCounter, int theMaxValue) : BaseCounter(theCounter, theMaxValue) {} void decrement() { counter = counter > 0 ? counter - 1 : max; } }; #endif