static void Main(string[] args)
        {
            DepositAccount peshoAccount = new DepositAccount(new Customer(CustomerType.Individual, "Pesho Peshev"), 500M, 2.3M);
            DepositAccount killersAccount = new DepositAccount(new Customer(CustomerType.Company, "Killers"), 1500M, 2.3M);
            peshoAccount.Deposit(250M);
            killersAccount.Withdraw(250M);
            Console.WriteLine("DEPOSIT ACCOUNTS TEST");
            Console.WriteLine("Balance: {0:C}", peshoAccount.Balance);
            Console.WriteLine("Balance: {0:C}", killersAccount.Balance);
            Console.WriteLine("Interest: {0:F2} %", peshoAccount.CalculateInterestAmount(3));
            Console.WriteLine("Interest: {0:F2} %", killersAccount.CalculateInterestAmount(4));
            Console.WriteLine();

            LoanAccount goshoAccount = new LoanAccount(new Customer(CustomerType.Individual, "Gosho Goshev"), 300M, 2.3M);
            LoanAccount leadersAccount = new LoanAccount(new Customer(CustomerType.Company, "Leaders"), 3000M, 2.3M);
            goshoAccount.Deposit(250M);
            leadersAccount.Deposit(250M);
            Console.WriteLine("LOAN ACCOUNTS TEST");
            Console.WriteLine("Balance: {0:C}", goshoAccount.Balance);
            Console.WriteLine("Balance: {0:C}", leadersAccount.Balance);
            Console.WriteLine("Interest: {0:F2} %", goshoAccount.CalculateInterestAmount(4));
            Console.WriteLine("Interest: {0:F2} %", leadersAccount.CalculateInterestAmount(4));
            Console.WriteLine();

            MortgageAccount mimiAccount = new MortgageAccount(new Customer(CustomerType.Individual, "Maria Petrova"), 200M, 2.3M);
            MortgageAccount deadboysAccount = new MortgageAccount(new Customer(CustomerType.Company, "Dead Boys"), 23000M, 2.3M);
            mimiAccount.Deposit(250M);
            deadboysAccount.Deposit(250M);
            Console.WriteLine("MORTGAGE ACCOUNTS TEST");
            Console.WriteLine("Balance: {0:C}", mimiAccount.Balance);
            Console.WriteLine("Balance: {0:C}", deadboysAccount.Balance);
            Console.WriteLine("Interest: {0:F2} %", mimiAccount.CalculateInterestAmount(8));
            Console.WriteLine("Interest: {0:F2} %", deadboysAccount.CalculateInterestAmount(18));
            Console.WriteLine();
        }
        static void Main(string[] args)
        {
            Console.WriteLine("Loan account: ");
            LoanAccount loanAcc = new LoanAccount(13.23m, 4.2m, Customer.personal, new DateTime(2013, 2, 1));

            Console.WriteLine(loanAcc.InterestOverMonths(2));
            Console.WriteLine(loanAcc.GetBalance);
            loanAcc.Deposit(4.54m);
            Console.WriteLine(loanAcc.GetBalance);

            Console.WriteLine("\n\nMortgage account: ");
            MortgageAccount mortAcc = new MortgageAccount(13.23m, 4.2m, Customer.personal, new DateTime(2013, 3, 5));

            Console.WriteLine(mortAcc.InterestOverMonths(8));
            Console.WriteLine(mortAcc.GetBalance);
            mortAcc.Deposit(55.3m);
            Console.WriteLine(mortAcc.GetBalance);

            Console.WriteLine("\n\nDeposit account: ");
            DepositAccount deposAcc = new DepositAccount(1200m, 3.2m, Customer.company, new DateTime(2012, 3, 5));

            Console.WriteLine(deposAcc.InterestOverMonths(5));
            Console.WriteLine(deposAcc.GetBalance);
            deposAcc.Deposit(200m);
            Console.WriteLine(deposAcc.GetBalance);
            deposAcc.WithdrawSum(55.35m);
            Console.WriteLine("Balance after withdrawal: {0}", deposAcc.GetBalance);
        }
Beispiel #3
0
        static void Main()
        {
            Customer kircho = new Individual("a001", "Kiro", "8503122535", new DateTime(1990, 10, 25), Gender.Male);

            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(string[] args)
        {
            Console.WriteLine("Loan account: ");
            LoanAccount loanAcc = new LoanAccount(13.23m, 4.2m, Customer.personal, new DateTime(2013, 2, 1));
            Console.WriteLine(loanAcc.InterestOverMonths(2));
            Console.WriteLine(loanAcc.GetBalance);
            loanAcc.Deposit(4.54m);
            Console.WriteLine(loanAcc.GetBalance);

            Console.WriteLine("\n\nMortgage account: ");
            MortgageAccount mortAcc = new MortgageAccount(13.23m, 4.2m, Customer.personal, new DateTime(2013, 3, 5));
            Console.WriteLine(mortAcc.InterestOverMonths(8));
            Console.WriteLine(mortAcc.GetBalance);
            mortAcc.Deposit(55.3m);
            Console.WriteLine(mortAcc.GetBalance);

            Console.WriteLine("\n\nDeposit account: ");
            DepositAccount deposAcc = new DepositAccount(1200m, 3.2m, Customer.company, new DateTime(2012, 3, 5));
            Console.WriteLine(deposAcc.InterestOverMonths(5));
            Console.WriteLine(deposAcc.GetBalance);
            deposAcc.Deposit(200m);
            Console.WriteLine(deposAcc.GetBalance);
            deposAcc.WithdrawSum(55.35m);
            Console.WriteLine("Balance after withdrawal: {0}", deposAcc.GetBalance);
        }
Beispiel #5
0
        static void Main()
        {
            Customers kris = new Individuals("Kris", "65654756765", "Sofia", new DateTime(1990, 10, 25));

            Customers krisOOD = new Companies("Kris OOD", "65654656765", "Plovdiv", 325343);

            Console.WriteLine(krisOOD is Individuals);
            Console.WriteLine(kris is Individuals);

            Bank mortgageAccTest  = new MortgageAccount(200.2m, 0.6m, kris);
            Bank mortgageAccTest1 = new MortgageAccount(200.2m, 0.6m, krisOOD);

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

            Bank loanAccTest  = new LoanAccount(200.2m, 0.6m, kris);
            Bank loanAccTest1 = new LoanAccount(200.2m, 0.6m, krisOOD);

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

            Bank depositAccTest  = new DepositAccount(3200.2m, 0.6m, kris);
            Bank depositAccTest1 = new DepositAccount(1200.2m, 0.6m, krisOOD);

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

            depositAccTest.Deposit(200);
            Console.WriteLine(depositAccTest.Balance);
            var depositAcc = depositAccTest as DepositAccount;

            depositAcc.Draw(300);
            Console.WriteLine(depositAcc.Balance);
        }
        static void Main(string[] args)
        {
            DepositAccount peshoAccount   = new DepositAccount(new Customer(CustomerType.Individual, "Pesho Peshev"), 500M, 2.3M);
            DepositAccount killersAccount = new DepositAccount(new Customer(CustomerType.Company, "Killers"), 1500M, 2.3M);

            peshoAccount.Deposit(250M);
            killersAccount.Withdraw(250M);
            Console.WriteLine("DEPOSIT ACCOUNTS TEST");
            Console.WriteLine("Balance: {0:C}", peshoAccount.Balance);
            Console.WriteLine("Balance: {0:C}", killersAccount.Balance);
            Console.WriteLine("Interest: {0:F2} %", peshoAccount.CalculateInterestAmount(3));
            Console.WriteLine("Interest: {0:F2} %", killersAccount.CalculateInterestAmount(4));
            Console.WriteLine();

            LoanAccount goshoAccount   = new LoanAccount(new Customer(CustomerType.Individual, "Gosho Goshev"), 300M, 2.3M);
            LoanAccount leadersAccount = new LoanAccount(new Customer(CustomerType.Company, "Leaders"), 3000M, 2.3M);

            goshoAccount.Deposit(250M);
            leadersAccount.Deposit(250M);
            Console.WriteLine("LOAN ACCOUNTS TEST");
            Console.WriteLine("Balance: {0:C}", goshoAccount.Balance);
            Console.WriteLine("Balance: {0:C}", leadersAccount.Balance);
            Console.WriteLine("Interest: {0:F2} %", goshoAccount.CalculateInterestAmount(4));
            Console.WriteLine("Interest: {0:F2} %", leadersAccount.CalculateInterestAmount(4));
            Console.WriteLine();

            MortgageAccount mimiAccount     = new MortgageAccount(new Customer(CustomerType.Individual, "Maria Petrova"), 200M, 2.3M);
            MortgageAccount deadboysAccount = new MortgageAccount(new Customer(CustomerType.Company, "Dead Boys"), 23000M, 2.3M);

            mimiAccount.Deposit(250M);
            deadboysAccount.Deposit(250M);
            Console.WriteLine("MORTGAGE ACCOUNTS TEST");
            Console.WriteLine("Balance: {0:C}", mimiAccount.Balance);
            Console.WriteLine("Balance: {0:C}", deadboysAccount.Balance);
            Console.WriteLine("Interest: {0:F2} %", mimiAccount.CalculateInterestAmount(8));
            Console.WriteLine("Interest: {0:F2} %", deadboysAccount.CalculateInterestAmount(18));
            Console.WriteLine();
        }