MathOddValidator.cpp 526 B

1234567891011121314151617181920212223242526
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2023-02-13
  6. * Changed: 2023-02-23
  7. *
  8. * */
  9. #include "MathOddValidator.hpp"
  10. using test::core::MathOddValidator;
  11. MathOddValidator::MathOddValidator() = default;
  12. MathOddValidator::~MathOddValidator() = default;
  13. bool MathOddValidator::isOdd() const
  14. {
  15. return this->isOddNumber;
  16. }
  17. void MathOddValidator::validate(int _number)
  18. {
  19. this->isOddNumber = _number % 2 != 0;
  20. }