You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

22 regels
451 B

  1. #include "pch.h"
  2. #include "MathLibrary.h"
  3. double MathLibrary::Divide(double a, double b) {
  4. if (b != 0) return a / b;
  5. return 0.0;
  6. }
  7. bool MathLibrary::IsPositive(int n) {
  8. return n >= 0;
  9. }
  10. bool MathLibrary::CheckRange(int a, int b) {
  11. return (a > 0) && (b < 10);
  12. }
  13. double MathLibrary::CalculateDiscount(int age, bool isMember) {
  14. if (age < 18)
  15. return isMember ? 0.25 : 0.20;
  16. else
  17. return isMember ? 0.15 : 0.10;
  18. }