Advertisement
Guest User

Untitled

a guest
May 28th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. type
  2. TRegistrationFee = class(TPercentCalculated)
  3. public
  4. class function New(
  5. OriginalValue: Currency): IMoney;
  6. end;
  7.  
  8. TDiscountRate = class(TPercentCalculated)
  9. public
  10. class function New(
  11. OriginalValue: Currency;
  12. Birthday: TDateTime): IMoney;
  13. end;
  14.  
  15. implementation
  16.  
  17. class function TRegistrationFee.New(
  18. OriginalValue: Currency): IMoney;
  19. begin
  20. Result := inherited Create(OriginalValue, 1);
  21. end;
  22.  
  23. class function TDiscountRate.New(
  24. OriginalValue: Currency;
  25. Birthday: TDateTime): IMoney;
  26. begin
  27. Result := inherited Create(
  28. OriginalValue,
  29. TIf.New(
  30. (Now - Birthday) < 18,
  31. 10,
  32. 0
  33. ).AsCurrency
  34. );
  35. end;
  36.  
  37. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement