public InterestCalculator(double money, double interest, int years, CalculateInterest calculationMethod)
 {
     this.Money = money;
     this.Interest = interest;
     this.Years = years;
     this.calculationMethod = calculationMethod;
 }
 public InterestCalculator(double money, double interest, int years, CalculateInterest interestCalcDelegate)
 {
     this.Money = money;
     this.Interest = interest;
     this.Years = years;
     this.interestCalcDelegate = interestCalcDelegate;
 }
Example #3
0
 public InterestCalculator(decimal money, decimal interes, int years, CalculateInterest type)
 {
     this.years   = years;
     this.type    = type;
     this.interes = interes;
     this.money   = money;
 }
Example #4
0
 public InterestCalculator(decimal sum, double interest, int years, CalculateInterest calculationType)
 {
     this.Sum             = sum;
     this.Interest        = interest;
     this.Years           = years;
     this.calculationType = calculationType;
 }
 public InterestCalculator(decimal moneyBalance, decimal interestRate, int years, CalculateInterest calculationMethod)
 {
     this.Balance = moneyBalance;
     this.InterestRate = interestRate;
     this.Years = years;
     this.calculationMethod = calculationMethod;
 }
 public InterestCalculator(decimal balance, decimal interest, byte years, CalculateInterest interestMethod)
 {
     this.Balance = balance;
     this.Interest = interest;
     this.Years = years;
     this.InterestMethod = interestMethod;
 }
 public InterestCalculator(decimal sum, decimal interest, int years, CalculateInterest calc)
 {
     this.sum      = sum;
     this.interest = interest;
     this.years    = years;
     this.calc     = calc;
 }
Example #8
0
 public InterestCalculator(decimal amount, decimal interest, int years, CalculateInterest simpleOrCompound)
 {
     this.Amount = amount;
     this.Interest = interest;
     this.Years = years;
     this.Result = simpleOrCompound(amount, interest, years);
 }
 public InterestCalculator(decimal money, double interest, int years, CalculateInterest myDelegate)
 {
     this.Money = money;
     this.Interest = interest;
     this.Years = years;
     this.myDelegate = myDelegate;
 }
 public InterestCalculator(decimal money, decimal interest, int year, CalculateInterest calculateInterest)
 {
     this.MoneyOfMoney = money;
     this.Interest = interest;
     this.Year = year;
     this.calculateInterest = calculateInterest;
 }
 public InterestCalculator(decimal money, double interest, int years, CalculateInterest val)
 {
     this.money = money;
     this.interest = interest;
     this.years = years;
     this.paybackValue = val(money, interest, years);
 }
Example #12
0
 public InterestCalculator(int money, decimal interest, int years, CalculateInterest calculate)
 {
     this.Money     = money;
     this.Interest  = interest;
     this.Years     = years;
     this.Calculate = calculate;
 }
Example #13
0
 public InterestCalculator(double money, double interest, int years, CalculateInterest del)
 {
     this.Money              = money;
     this.Interest           = interest;
     this.Years              = years;
     this.CalculatedInterest = del(money, interest, years);
 }
 public InterestCalculator(double sum, double interest, int years, CalculateInterest calculationMethod)
 {
     this.Sum = sum;
     this.Interest = interest;
     this.Years = years;
     this.CalculateInterest = calculationMethod(sum,interest,years);
 }
 public InterestRateCalculator(decimal sum, double interest, int years, CalculateInterest interestDelegate)
 {
     this.Sum = sum;
     this.Interest = interest;
     this.Years = years;
     this.interestDelegate = interestDelegate;
 }
 public InterestCalculator(double s, double i, int y, CalculateInterest type)
 {
     this.sum = s;
     this.interest = i;
     this.years = y;
     this.ci = type;
 }
Example #17
0
 public InterestCalculator(double s, double i, int y, CalculateInterest type)
 {
     this.sum      = s;
     this.interest = i;
     this.years    = y;
     this.ci       = type;
 }
Example #18
0
 public InterestCalculator(decimal money, double interest, int years, CalculateInterest type)
 {
     this.Money    = money;
     this.Interest = interest;
     this.Years    = years;
     this.result   = type(money, interest, years);
 }
 public InterestCalculator(decimal money, double interestRate, int years, CalculateInterest calculateInterest)
 {
     this.Money             = money;
     this.Years             = years;
     this.InterestRate      = interestRate;
     this.CalculateInterest = calculateInterest;
 }
Example #20
0
 public InterestCalculator(decimal money, decimal interestRate, int years, CalculateInterest interestCalculationDelegate)
 {
     this.Money        = money;
     this.InterestRate = interestRate;
     this.Years        = years;
     this.InterestCalculationDelegate = interestCalculationDelegate;
 }
 public InterestCalculator(decimal amount, double interest, int years, CalculateInterest calculateInterest)
 {
     this.Amount = amount;
     this.Interest = interest;
     this.Years = years;
     this.CalculateInterest = calculateInterest;
 }
 public InterestCalculator(decimal money, double interest, int years, CalculateInterest type)
 {
     this.Money = money;
     this.Interest = interest;
     this.Years = years;
     this.ResultValue = type(money, interest, years);
 }
Example #23
0
 public InterestCalculator(decimal money, double interest, int years, CalculateInterest calcInterest)
 {
     this.Money      = money;
     this.Interest   = interest;
     this.Years      = years;
     this.TotalMoney = calcInterest(money, interest, years);
 }
Example #24
0
 public InterestCalculator(double sum, double interest, int years, CalculateInterest calcInterest)
 {
     this.interest = interest/100;
     this.sum = sum;
     this.years = years;
     this.calcIterest = calcInterest;
 }
 //constructor with delegate
 public InterestCalculator(decimal sum, decimal interest, int years, CalculateInterest calcMethod)
 {
     this.Sum = sum;
     this.Interest = interest;
     this.Years = years;
     this.earnedInterest = calcMethod(this.sum, this.interest, this.years);
 }
 public InterestCalculator(double money, double interest, int years, CalculateInterest calculationMethod)
 {
     this.Money             = money;
     this.Interest          = interest;
     this.Years             = years;
     this.calculationMethod = calculationMethod;
 }
Example #27
0
 public InterestCalculator(decimal money, double interest, int years, CalculateInterest calcInterest)
 {
     this.Money = money;
     this.Interest = interest;
     this.Years = years;
     this.TotalMoney = calcInterest(money, interest, years);
 }
Example #28
0
 public InterestCalculator(decimal sum, double interest, int years, CalculateInterest type)
 {
     this.sum      = sum;
     this.interest = interest;
     this.years    = years;
     this.type     = type;
 }
Example #29
0
 public InterestCalculator(decimal money, decimal interest, int years, CalculateInterest type)
 {
     this.Money = money;
     this.Interest = interest;
     this.Years = years;
     this.Type = type;
 }
Example #30
0
 public InterestCalculator(decimal sumMoney, double interest, int years, CalculateInterest d)
 {
     this.SumMoney      = sumMoney;
     this.Interest      = interest;
     this.Years         = years;
     this.DelegateValue = d(sumMoney, interest, years);
 }
 public InterestCalculator(decimal sum, double interest, int years, CalculateInterest type)
 {
     this.sum = sum;
     this.interest = interest;
     this.years = years;
     this.type = type;
 }
Example #32
0
 // Main Constructor
 public InterestCalculator(decimal sum, decimal interest, int years, CalculateInterest type)
 {
     this.Sum = sum;
     this.Interest = interest;
     this.Years = years;           
     this.type = type;
 }
Example #33
0
 public InterestCalculator(double money, double interest, int years, CalculateInterest CalculateInterest)
 {
     this.Money          = money;
     this.Interest       = interest / 100;
     this.Years          = years;
     this.InterestResult = CalculateInterest(this.Money, this.Interest, this.Years);
 }
Example #34
0
 public InterestCalculator(decimal moneyBalance, decimal interestRate, int years, CalculateInterest calculationMethod)
 {
     this.Balance           = moneyBalance;
     this.InterestRate      = interestRate;
     this.Years             = years;
     this.calculationMethod = calculationMethod;
 }
 public InterestCalculator(decimal money, decimal interes, int years, CalculateInterest type)
 {
     this.years = years;
     this.type = type;
     this.interes = interes;
     this.money = money;
 }
Example #36
0
 public InterestCalculator(decimal money, double interest, int years, CalculateInterest calcInterest)
 {
     this.Money        = money;
     this.Years        = years;
     this.Interest     = interest;
     this.paybackValue = calcInterest(this.Money, this.Interest, this.Years);
 }
 public InterestCalculator(double sum, double interest, int years, CalculateInterest del)
 {
     this.sumOfMoney = sum;
     this.interest   = interest;
     this.years      = years;
     this.paybackVal = del(sum, interest, years);
 }
 public InterestCalculator(decimal money, decimal interest, int years, CalculateInterest type)
 {
     Interest = interest;
     Years = years;
     this.type = type;
     Money = money;
 }
Example #39
0
 public InterestCalculator(decimal sum, decimal interest, int period, CalculateInterest kindOfInterest)
 {
     this.Sum            = sum;
     this.Interest       = interest;
     this.Period         = period;
     this.kindOfInterest = kindOfInterest;
     this.Result         = kindOfInterest(sum, interest, period);
 }
Example #40
0
 public InterestCalculator(decimal sum, double interest, int years, CalculateInterest method)
 {
     this.sum = sum;
     this.interest = interest;
     this.years = years;
     this.method = method;
     this.result = this.method(this.sum, this.interest, this.years);
 }
Example #41
0
 public InterestCalculator(
     double sum, double interest, int years, CalculateInterest calculateMethod)
 {
     this.Sum                = sum;
     this.Interest           = interest;
     this.Years              = years;
     this.CalculatedInterest = calculateMethod(this.Sum, this.Interest, this.Years);
 }
Example #42
0
 public InterestCalculator(decimal sum, double interest, int years, CalculateInterest method)
 {
     this.sum      = sum;
     this.interest = interest;
     this.years    = years;
     this.method   = method;
     this.result   = this.method(this.sum, this.interest, this.years);
 }
Example #43
0
 public InterestCalculator(double moneySum, double interest, int years,
                           CalculateInterest interestDelegate)
 {
     this.Money             = moneySum;
     this.Interest          = interest;
     this.Years             = years;
     this._interestDelegate = interestDelegate;
 }
Example #44
0
 public InterestCalculator(decimal sum, double interest, int years, CalculateInterest interstCalculation)
 {
     this.Sum                 = sum;
     this.Interest            = interest;
     this.Years               = years;
     this.interestCalculation = interstCalculation(sum, interest, years);
     this.typeOfCalculation   = new CalculateInterest(interstCalculation);
 }
Example #45
0
        static void Main(string[] args)
        {
            CalculateInterest interest = new CalculateInterest(GetSimpleInterest);

            interest(2500m, 7.2m, 15);
            interest = GetCompoundInterest;
            interest(500m, 5.6m, 10);
        }
Example #46
0
 public InterestCalculator(double money, double interest, int years, CalculateInterest interestCalculationDelegate, string type)
 {
     this.Money    = money;
     this.Interest = interest;
     this.Years    = years;
     this.interestCalculationDelegate = interestCalculationDelegate;
     this.Type = type;
 }
    public InterestCalculator(double money, double interest, int years, CalculateInterest del)
    {
        this.Money = money;
        this.Interest = interest;
        this.Years = years;
        this.CalculatedInterest = del(money, interest, years);

    }
Example #48
0
 public InterestCalculator(decimal money, float interest, int years, CalculateInterest interestCalculation)
 {
     this.Money               = money;
     this.Interest            = interest;
     this.Years               = years;
     this.InterestCalculation = interestCalculation;
     this.MoneyAfterIdexation = InterestCalculation(money, interest, years);
 }
Example #49
0
 public InterestCalculator(decimal money, decimal interest, int years,
                           CalculateInterest method)
 {
     Money    = money;
     Interest = interest;
     Years    = years;
     this.caclulationMethod = method;
 }
 public InterestCalculator(double money, double interest, int years, CalculateInterest interestCalculationDelegate, string type)
 {
     this.Money = money;
     this.Interest = interest;
     this.Years = years;
     this.interestCalculationDelegate = interestCalculationDelegate;
     this.Type = type;
 }
Example #51
0
        public double?TotalInterest()
        {
            if (_totalInterest == null)
            {
                _totalInterest = CalculateInterest.Calculate(Wallets);
            }

            return(_totalInterest);
        }
Example #52
0
        public double?TotalInterest()
        {
            if (_totalInterest == null)
            {
                _totalInterest = CalculateInterest.Calculate(InterestRate(), _balance);
            }

            return(_totalInterest);
        }
Example #53
0
        public void CalculateCompoundInterestStringValue__ShoulReturnErrorWhenInterestRateIsLessThanZero(string initialValue)
        {
            CalculateInterest calculateInterest = new CalculateInterest();
            double            interestRate      = -0.01;
            int months = 0;

            var result = calculateInterest.CalculateCompoundInterestStringValue(initialValue, interestRate, months);

            Assert.Equal("[API1] - O serviço integrado retornou um valor para taxa de juros negativo.", result);
        }
Example #54
0
        public static void Main()
        {
            CalculateInterest  simpleInterestCalculationDelegate   = GetSimpleInterest;
            CalculateInterest  compoundInterestCalculationDelegate = GetCompoundInterest;
            InterestCalculator simpleCalc   = new InterestCalculator(2500, 7.2, 15, simpleInterestCalculationDelegate, "simple");
            InterestCalculator compoundCalc = new InterestCalculator(500, 5.6, 10, compoundInterestCalculationDelegate, "compound");

            Console.WriteLine(simpleCalc);
            Console.WriteLine(compoundCalc);
        }
Example #55
0
 public InterestCalculator(
     double sum,
     double interest,
     int years,
     CalculateInterest interestdelegate)
 {
     this.Sum = sum;
     this.Interest = interest;
     this.Years = years;
     this.interestdelegate = interestdelegate;
 }
Example #56
0
 static void Main()
 {
     Console.Write("Type amount of money: ");
     decimal money = decimal.Parse(Console.ReadLine());
     Console.Write("Type interest: ");
     double interest = double.Parse(Console.ReadLine());
     Console.Write("Type years: ");
     int years = int.Parse(Console.ReadLine());
     CalculateInterest d = new CalculateInterest(GetSimpleInterest);
     d += GetCompountInterest;
     InterestCalculator calc = new InterestCalculator(money, interest/100, years);
     Console.Write("Enter the type of the interest(simple or compound): ");
     calc.Type = Console.ReadLine();
     if (calc.Type == "compound")
     {
         d -= GetSimpleInterest;
     }
     else if (calc.Type == "simple")
     {
         d -= GetCompountInterest;
     }
     while (calc.Type != "compound" && calc.Type != "simple")
     {
         Console.Write("Try again: ");
         calc.Type = Console.ReadLine();
         if (calc.Type == "compound")
         {
             d -= GetSimpleInterest;
         }
         else if (calc.Type == "simple")
         {
             d -= GetCompountInterest;
         }
     }
     calc.OnInterest += d;
     calc.Run();
 }
Example #57
0
 public InterestCalculator(decimal money, double interest, double years, CalculateInterest calculate)
 {
     this.calculatedInterest = calculate(money, interest, years);
 }