コード例 #1
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);
 }
コード例 #2
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);
        }