private static void Main(string[] args)
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

            var individ = new Individual("a");
            var company = new Company("company");
            var mortgage1 = new Mortgage(individ,4,5);
            var mortgage2 = new Mortgage(company,4,5);
            var loan = new Loan(company,3123000,3.2m);

            Console.WriteLine(mortgage1.CalculateInterest(7));
            Console.WriteLine(mortgage2.CalculateInterest(7));
            Console.WriteLine(loan.CalculateInterest(8));
        }
Exemplo n.º 2
0
        public static void Main()
        {
            var client = new Individual("Client", "Sofia", 23);
            var account = new DepositAccount(client, 1000, 2);
            Console.WriteLine(account.Balance);
            //making a deposit of 100
            account.Deposit(100);
            //money after the deposit
            Console.WriteLine(account.Balance);
            //interest after 14months
            Console.WriteLine(account.CalculaterInterest(14));
            //making a withdraw
            account.Withdraw(500);
            Console.WriteLine(account.Balance);

            var account1 = new LoanAccount(new Company("ComapanySoft", "Varna", "1024443"), 10400, 7);
            //interest after 6months
            Console.WriteLine(account1.CalculaterInterest(6));
        }