Esempio n. 1
0
        static void Main(string[] args)
        {
            var account = new Account();

            account.GetAccType(new BaseAccount());
            var account1 = new BaseAccount {
                Balance = 100000000, Interest = 10000
            };

            Calculator.CalculateBaseInterest(account1);

            Console.WriteLine();

            account.GetAccType(new SalaryAccount());
            var account2 = new SalaryAccount {
                Balance = 124000, Interest = 1240
            };

            Calculator.CalculateSalaryInterest(account2);
        }
Esempio n. 2
0
 public static void CalculateSalaryInterest(SalaryAccount account)
 {
     account.Interest = account.Balance * 0.5;
     Console.WriteLine(account.Interest);
 }