Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 4
0
        static void Main()
        {
            //Deposit Test
            var depositAccIndividual = new DepositAccount(CustomerType.Individual, 2000.78m, 0.5m);

            Console.WriteLine("Customer: {0} | Balance: ${1:F2} | Interest Amount (12 Months): ${2:F2}",
                              depositAccIndividual.Customer, depositAccIndividual.Balance, depositAccIndividual.InterestAmount(12));

            depositAccIndividual.Withdraw(1500);
            Console.WriteLine("Balance after Withdraw: ${0:F2}", depositAccIndividual.Balance);
            Console.WriteLine();

            //Loan Test
            var loanAccCompany = new LoanAccount(CustomerType.Company, 3000000.1234m, 1.0m);

            Console.WriteLine("Customer: {0} | Balance: ${1:F2} | Interest Amount (1 Month): ${2:F2}",
                              loanAccCompany.Customer, loanAccCompany.Balance, loanAccCompany.InterestAmount(1));

            loanAccCompany.Deposit(1500000);
            Console.WriteLine("Balance after Deposit: ${0:F2}", loanAccCompany.Balance);
            Console.WriteLine("Interest Amount (13 Months): ${0:F2}", loanAccCompany.InterestAmount(13));
            Console.WriteLine();

            //Mortage Test
            var mortageAccCompany = new MortageAccount(CustomerType.Company, 17000000.98m, 1.5m);

            Console.WriteLine("Customer: {0} | Balance: ${1:F2} | Interest Amount (1 Month): ${2:F2}",
                              mortageAccCompany.Customer, mortageAccCompany.Balance, mortageAccCompany.InterestAmount(1));


            var mortageAccIndividual = new MortageAccount(CustomerType.Individual, 105000.13m, 1.0m);

            Console.WriteLine("Customer: {0} | Balance: ${1:F2} | Interest Amount (1 Month): ${2:F2}",
                              mortageAccIndividual.Customer, mortageAccIndividual.Balance, mortageAccIndividual.InterestAmount(1));
        }