public static void Main()
        {
            Console.WriteLine("Deposit Account: ");

            var depositAcc = new DepositAccount(new Individual("Katya Ivanova", 213, new DateTime(1996, 5, 21), Gender.Female), 200000, 4);

            Console.WriteLine(depositAcc.ToString());
            depositAcc.AddMoney(20000);
            depositAcc.WithdrawMoney(213);

            Console.WriteLine("{0} Interest amount: {1}%", depositAcc.GetType().Name, depositAcc.InterestAmount(8)); // interest amount method

            Console.WriteLine(new string('-', 50));

            var companyDeposit = new DepositAccount(new Company("Apple", 12345, "Steve Jobs"), 52342343, 234);

            Console.WriteLine(companyDeposit.ToString());

            Console.WriteLine(new string('-', 50));

            Console.WriteLine("Loan Deposit: ");
            var loanDeposit = new LoanAccount(new Individual("Dimitur Topchev", 213, new DateTime(1992, 12, 14), Gender.Male), 2000, 2);

            Console.WriteLine(loanDeposit.ToString());
            Console.WriteLine("Interest amount {0}%", loanDeposit.InterestAmount(12));
            loanDeposit.AddMoney(23456);

            Console.WriteLine(new string('-', 50));

            Console.WriteLine("Mortgage Deposit");
            var mortgageAcc = new MortgageAccount(new Company("BFFS", 12383128, "Golemata Hazna"), 2500000, 0.1m);

            Console.WriteLine(mortgageAcc.ToString());
            Console.WriteLine("Interest amount {0}%", mortgageAcc.InterestAmount(12));
        }
Exemple #2
0
        static void Main(string[] args)
        {
            LoanAccount     loan     = new LoanAccount(new Customer(TypeOfCustomer.IndividualClient, "Pesho Goshev", 123963), 12500, 1, 2);
            DepositAccount  deposit  = new DepositAccount(new Customer(TypeOfCustomer.CompanyClient, "Boc-Boc OOD", 789369), 5000000, 5, 3);
            MortgageAccount mortgage = new MortgageAccount(new Customer(TypeOfCustomer.IndividualClient, "Gosho Peshev", 159357), 147258, 4, 8);


            loan.Deposit(100);
            Console.WriteLine("The ballance of {0} is : {1}", loan.Customer.CustomerName, loan.Ballance);
            Console.WriteLine("The customer ID of {0} is : {1}", deposit.Customer.CustomerName, deposit.Customer.customerID);
            Console.WriteLine("The ballance of {0} is : {1}", deposit.Customer.CustomerName, deposit.Ballance);
            deposit.Deposit(100000);
            Console.WriteLine("The ballance of {0} after deposit is : {1}", deposit.Customer.CustomerName, deposit.Ballance);
            mortgage.InterestAmount(3);
        }
Exemple #3
0
        static void Main()
        {
            // Deposit Account Tests
            Console.WriteLine("Deposit Account Test:");
            Console.WriteLine();

            var individualDeposit = new DepositAccount(new Individual("Joro Ivanov", 666, new DateTime(1995, 3, 8), GenderType.Male), 100000, 3);

            Console.WriteLine("Before depositing and withdrawing money");
            Console.WriteLine(individualDeposit);
            individualDeposit.DepositMoney(15600);
            individualDeposit.WithdrawMoney(854);
            Console.WriteLine("After depositing and withdrawing money");
            Console.WriteLine(individualDeposit);

            Console.WriteLine("{0} Interest amount: {1}%", individualDeposit.GetType().Name, individualDeposit.InterestAmount(8));

            Console.WriteLine(new string('-', 50));

            var companyDeposit = new DepositAccount(new Company("Batman Inc", 1, "Bruce Wayne"), 200006, 111);

            Console.WriteLine(companyDeposit);

            Console.WriteLine(new string('-', 50));

            // Loan Account Tests
            Console.WriteLine("Loan Account Test:");
            Console.WriteLine();

            var loanAccount = new LoanAccount(new Individual("Penka Draganova", 5, new DateTime(1990, 11, 21), GenderType.Female), 1000, 2);

            Console.WriteLine(loanAccount);
            Console.WriteLine("Interest amount {0}%", loanAccount.InterestAmount(12));
            loanAccount.DepositMoney(2000);     // Paying the loan

            Console.WriteLine(new string('-', 50));

            // Mortgage Account Tests
            Console.WriteLine("Mortgage Account Test:");
            Console.WriteLine();

            var mortgageAcc = new MortgageAccount(new Company("Ivo's Company", 19500, "Ivo"), 280000, 5.5m);

            Console.WriteLine(mortgageAcc);
            Console.WriteLine("Interest amount {0}%", mortgageAcc.InterestAmount(12));
        }
Exemple #4
0
        public static void Main()
        {
            // Some tests
            Console.WriteLine("Deposit Account: ");

            var depositAcc = new DepositAccount(new Individual("Tanya Skovska", 213, new DateTime(1994, 5, 26), Gender.Female), 200000, 4);

            Console.WriteLine(depositAcc.ToString());
            depositAcc.AddMoney(20000);
            depositAcc.WithdrawMoney(213);

            Console.WriteLine("{0} Interest amount: {1}%", depositAcc.GetType().Name, depositAcc.InterestAmount(8)); // interest amount method

            Console.WriteLine(new string('-', 50));

            var companyDeposit = new DepositAccount(new Company("Microsoft INC", 12345, "Bil Geits"), 44352423432, 234);

            Console.WriteLine(companyDeposit.ToString());

            Console.WriteLine(new string('-', 50));

            Console.WriteLine("Loan Deposit: ");
            var loanDeposit = new LoanAccount(new Individual("Pesho Peshov", 213, new DateTime(1990, 12, 16), Gender.Male), 2000, 2);

            Console.WriteLine(loanDeposit.ToString());
            Console.WriteLine("Interest amount {0}%", loanDeposit.InterestAmount(12));
            loanDeposit.AddMoney(23456);

            Console.WriteLine(new string('-', 50));

            Console.WriteLine("Mortgage Deposit");
            var mortgageAcc = new MortgageAccount(new Company("BFS", 12383128, "Golqmata Peruka"), 2500000, 0.1m);

            Console.WriteLine(mortgageAcc.ToString());
            Console.WriteLine("Interest amount {0}%", mortgageAcc.InterestAmount(12));
        }