Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type
- TRegistrationFee = class(TPercentCalculated)
- public
- class function New(
- OriginalValue: Currency): IMoney;
- end;
- TDiscountRate = class(TPercentCalculated)
- public
- class function New(
- OriginalValue: Currency;
- Birthday: TDateTime): IMoney;
- end;
- implementation
- class function TRegistrationFee.New(
- OriginalValue: Currency): IMoney;
- begin
- Result := inherited Create(OriginalValue, 1);
- end;
- class function TDiscountRate.New(
- OriginalValue: Currency;
- Birthday: TDateTime): IMoney;
- begin
- Result := inherited Create(
- OriginalValue,
- TIf.New(
- (Now - Birthday) < 18,
- 10,
- 0
- ).AsCurrency
- );
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement