Exemplo n.º 1
0
        static void Main()
        {
            Customer kircho = new Individual("a001", "Kiro", "8503122535", new DateTime(1990, 10, 25));

            Customer firmata = new Company("a002", "p2p", "503122535");

            Console.WriteLine(firmata is Individual);
            Console.WriteLine(kircho is Individual);

            BankAccount mortgageAccTest = new MortgageAccount(200.2m, 0.6m, kircho);
            BankAccount mortgageAccTest1 = new MortgageAccount(200.2m, 0.6m, firmata);

            Console.WriteLine(mortgageAccTest.CalculateInterest(15));
            Console.WriteLine(mortgageAccTest1.CalculateInterest(15));

            BankAccount loanAccTest = new LoanAccount(200.2m, 0.6m, kircho);
            BankAccount loanAccTest1 = new LoanAccount(200.2m, 0.6m, firmata);

            Console.WriteLine(loanAccTest.CalculateInterest(11));
            Console.WriteLine(loanAccTest1.CalculateInterest(11));

            BankAccount depositAccTest = new DepositAccount(3200.2m, 0.6m, kircho);
            BankAccount depositAccTest1 = new DepositAccount(1200.2m, 0.6m, firmata);

            Console.WriteLine(depositAccTest.CalculateInterest(11));
            Console.WriteLine(depositAccTest1.CalculateInterest(11));

            depositAccTest.Deposit(200);
            Console.WriteLine(depositAccTest.Balance);
            var depositAcc = depositAccTest as DepositAccount;
            depositAcc.Withdraw(300);
            Console.WriteLine(depositAcc.Balance);
        }
        static void Main()
        {
            Customer individual = new Individual("Some Individual");
            Customer company = new Company("Some Company");
            Customer otherIndividual = new Individual("SomeOther Individual");
            Customer otherCompany = new Company("SomeOther Company");


            Account individualLoanAccount = new LoanAccount(individual, 2000, 2);
            decimal interest = individualLoanAccount.CalculateInterestAmount(5);

            Console.WriteLine(interest);

            Account companyMortgageAccount = new MortgageAccount(company, 20000, 3);
            interest = companyMortgageAccount.CalculateInterestAmount(5);

            Console.WriteLine(interest);

            Account depositIndividualAccount = new DepositAccount(individual, 900, 1.5M);
            depositIndividualAccount.Deposit(1000);
            interest = depositIndividualAccount.CalculateInterestAmount(2);
            Console.WriteLine(interest);


        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            Individual Celin = new Individual("Celin");
            Company Dion = new Company("Dion");

            Loan loanAcc = new Loan(Celin, 1, 7.5);
            Deposit depositAcc = new Deposit(Dion, 33000, 20);

            loanAcc.DepositAmount(100);
            Console.WriteLine(loanAcc.Balance);

            depositAcc.WithdrawAmount(5000);
            Console.WriteLine(depositAcc.Balance);

            Console.WriteLine(depositAcc.InterestAmount(12));
        }
Exemplo n.º 4
0
        static void Main()
        {
            //most boring part of the code :)))

            Individual niki = new Individual("Nokolay Kostov", 020456432, "Sofia, ul. Gyueshevo", "8243567823");
            Company telerik = new Company("Telerik", 010454378, "Sofia, Mladost", "845234087");

            Loan loanAcc = new Loan(1500M, 4.5M, niki);
            Deposit depositAcc = new Deposit(160000, 10000, telerik);

            loanAcc.DepositTrans(100);
            Console.WriteLine(loanAcc.Balance);

            depositAcc.WithdrawTrans(5000);
            Console.WriteLine(depositAcc.Balance);

            Console.WriteLine(depositAcc.Interest(12));
        }