Exemplo n.º 1
0
 public static void Main()
 {
     IndividualCustomer pesho = new IndividualCustomer("Pesho");
     CompanyCustomer telerik = new CompanyCustomer("Telerik");
     LoanAccount loanAcc = new LoanAccount(pesho, 250, 25);
     DepositAccount depositAcc = new DepositAccount(telerik, 10000, 20);
     loanAcc.DepositAmount(100);
     Console.WriteLine(loanAcc.Balance);
     depositAcc.WithdrawAmount(5000);
     Console.WriteLine(depositAcc.Balance);
     Console.WriteLine(depositAcc.CalculateInterestAmount(12));
 }
Exemplo n.º 2
0
        static void Main()
        {
            IndividualCustomer inCustomerPesho = new IndividualCustomer("Pesho");
            CompanyCustomer comCustomerGoshoOOD = new CompanyCustomer("Gosho OOD");

            DepositAccount peshoDepositAcc = new DepositAccount(inCustomerPesho,500m);
            LoanAccount goshoLoanAcc = new LoanAccount(comCustomerGoshoOOD, 600m);
            MortgageAccount goshoMorAcc = new MortgageAccount(comCustomerGoshoOOD,550m);

            Console.WriteLine("\tPesho acc info");
            Console.WriteLine();

            Console.WriteLine("Balance in the begining: {0}",peshoDepositAcc.Balance);
            peshoDepositAcc.DepositAmount(6000m);
            Console.WriteLine("Balance after deposit: {0}",peshoDepositAcc.Balance);
            peshoDepositAcc.WithdrawAmount(100m);
            Console.WriteLine("Balance after withdraw: {0}",peshoDepositAcc.Balance);
            Console.WriteLine("Interest Amount: " + peshoDepositAcc.CalculateInterestAmount(50));

            Console.WriteLine();
            Console.WriteLine(new string('-',30));
            Console.WriteLine();
            Console.WriteLine("\t Gosho loan acc info");
            Console.WriteLine();

            Console.WriteLine("Balance in the begining: {0}",goshoLoanAcc.Balance);
            goshoLoanAcc.DepositAmount(50000m);
            Console.WriteLine("Balance after deposit: {0}",goshoLoanAcc.Balance);
            Console.WriteLine("Interest Amount: " + goshoLoanAcc.CalculateInterestAmount(25));
            Console.WriteLine();
            Console.WriteLine(new string('-', 30));
            Console.WriteLine();
            Console.WriteLine("\t Gosho Mortgage acc info");
            Console.WriteLine();

            Console.WriteLine("Balance in the begining: {0}",goshoMorAcc.Balance);
            goshoMorAcc.DepositAmount(50);
            Console.WriteLine("Balance after deposit: {0}",goshoMorAcc.Balance);
            Console.WriteLine("Interest Amount: " + goshoMorAcc.CalculateInterestAmount(5));
        }