Esempio n. 1
0
        public static void Main()
        {
            InterestCalculateFunctions mySimpleInterestCalculation = new InterestCalculateFunctions(2500.0, 7.2, 15);
            Func<double, double, uint, decimal> CalculateSimpleInterest = mySimpleInterestCalculation.GetSimpleInterest;
            decimal result = CalculateSimpleInterest(mySimpleInterestCalculation.Sum, mySimpleInterestCalculation.Interest, mySimpleInterestCalculation.Year);
            Console.WriteLine("{0:F4}", result);

            InterestCalculateFunctions myCompoundInterestCalculation =
            new InterestCalculateFunctions(500, 5.6, 10);
            Func<double, double, uint, decimal> CalculateCompoundInterest = myCompoundInterestCalculation.GetCompoundInterest;
            decimal compoundResult = CalculateCompoundInterest(myCompoundInterestCalculation.Sum,
                myCompoundInterestCalculation.Interest, myCompoundInterestCalculation.Year);
            Console.WriteLine("{0:F4}", compoundResult);
        }
Esempio n. 2
0
        public static void Main()
        {
            InterestCalculateFunctions           mySimpleInterestCalculation = new InterestCalculateFunctions(2500.0, 7.2, 15);
            Func <double, double, uint, decimal> CalculateSimpleInterest     = mySimpleInterestCalculation.GetSimpleInterest;
            decimal result = CalculateSimpleInterest(mySimpleInterestCalculation.Sum, mySimpleInterestCalculation.Interest, mySimpleInterestCalculation.Year);

            Console.WriteLine("{0:F4}", result);

            InterestCalculateFunctions myCompoundInterestCalculation =
                new InterestCalculateFunctions(500, 5.6, 10);
            Func <double, double, uint, decimal> CalculateCompoundInterest = myCompoundInterestCalculation.GetCompoundInterest;
            decimal compoundResult = CalculateCompoundInterest(myCompoundInterestCalculation.Sum,
                                                               myCompoundInterestCalculation.Interest, myCompoundInterestCalculation.Year);

            Console.WriteLine("{0:F4}", compoundResult);
        }