示例#1
0
        static void Main()
        {
            Bank     bank      = new Bank();
            Customer customer1 = new Customer("Gosho", CustomersEnumerator.Individuals);
            Customer customer2 = new Customer("Tosho", CustomersEnumerator.Companies);
            Customer customer3 = new Customer("Pesho", CustomersEnumerator.Individuals);
            Customer customer4 = new Customer("Ceca", CustomersEnumerator.Companies);

            Deposit  c1Account1 = new Deposit(customer1, 2000, DateTime.Now, 7m);
            Mortgage c1Account2 = new Mortgage(customer1, 5000, new DateTime(2012, 10, 20), 6.55m);

            Mortgage c2Account1 = new Mortgage(customer2, 1000, new DateTime(2010, 12, 29), 3.88m);
            Loan     c2Account2 = new Loan(customer2, 5000, new DateTime(2015, 2, 2), 12.65m);

            Loan    c3Account1 = new Loan(customer2, 5000, new DateTime(2015, 2, 2), 12.65m);
            Deposit c3Account2 = new Deposit(customer4, 10000, new DateTime(2000, 11, 10), 18m);

            Deposit  c4Account1 = new Deposit(customer4, 500, new DateTime(2000, 3, 5), 18m);
            Mortgage c4Account2 = new Mortgage(customer2, 1300, new DateTime(2009, 5, 29), 3.88m);
            Loan     c4Account3 = new Loan(customer2, 300, new DateTime(2011, 3, 3), 12.65m);

            bank.Add(c1Account1);
            bank.Add(c1Account2);
            bank.Add(c2Account1);
            bank.Add(c2Account2);
            bank.Add(c3Account1);
            bank.Add(c3Account2);
            bank.Add(c4Account1);
            bank.Add(c4Account2);
            bank.Add(c4Account3);

            c1Account1.DepositMoney(1000);
            c2Account2.DepositMoney(500);
            c4Account1.DrawMoney(600);
            c4Account1.DepositMoney(0);
            c1Account1.DrawMoney(2000);

            Console.WriteLine(c1Account1.CalculateInterestAmount());

            Console.WriteLine(c2Account2.CalculateInterestAmount());
        }
        static void Main()
        {
            Bank bank = new Bank("SomeBank");

            Customer newOwner = new Customer("Stamat", CustomerType.Individual);
            Deposit deposit = new Deposit(newOwner, 1000, 5.5m);
            bank.AddAccount(deposit);

            Customer secondOwner = new Customer("SomeLargeCompanyWitchConstructsTermometri", CustomerType.Company);
            Mortgage loan = new Mortgage(secondOwner, 10000000, 6.5m);
            bank.AddAccount(loan);

            Console.WriteLine(bank);

            for (int i = 0; i < bank.AllAccounts.Count; i++)
            {
                Console.WriteLine();
                Console.WriteLine("Account {0}: ", i + 1);
                Console.WriteLine(bank.AllAccounts[i]);
            }
        }
示例#3
0
        public static void Main()
        {
            // Some accounts
            Deposite firstDeposite  = new Deposite(Customers.Companies, 100000, 1.4m);
            Deposite secondDeposite = new Deposite(Customers.Individuals, 2500, 3.4m);

            Loan firstLoan  = new Loan(Customers.Companies, 2400000m, 2.7m);
            Loan secondLoan = new Loan(Customers.Individuals, 7500, 1.001m);

            Mortgage firstMortgage  = new Mortgage(Customers.Companies, 12400m, 5.1m);
            Mortgage secondMortgage = new Mortgage(Customers.Individuals, 4500, 0.11m);

            // Add and with draw some money
            firstDeposite.WithDrawMoney(1000.0m);
            secondDeposite.DepositeMoney(1000.0m);
            secondLoan.DepositeMoney(100);
            firstMortgage.DepositeMoney(600);

            // Calculate interests of amount
            decimal firstAmount = firstDeposite.CalculateInterestAmount(12);

            Console.WriteLine("Interest amount {0:F3} %", firstAmount);

            decimal secondAmount = firstMortgage.CalculateInterestAmount(7);

            Console.WriteLine("Interest amount {0:F3} %\n", secondAmount);

            // Create a bank
            Bank bank = new Bank();

            // Adding some accounts in the bank
            bank.AddDepositeAccount(firstDeposite, secondDeposite);
            bank.AddLoanAccount(firstLoan, secondLoan);
            bank.AddMortgageAccount(firstMortgage, secondMortgage);

            // Print information about all account in the bank
            Console.WriteLine(bank.DepositeAccounts);
            Console.WriteLine(bank.LoanAccounts);
            Console.WriteLine(bank.MortgageAccounts);
        }
示例#4
0
        static void Main()
        {
            Deposite depositeIndividualStanimir       = new Deposite(new Individual("Stanimir"), 2003, 5);
            Deposite depositeCompanyGeograficNational = new Deposite(new Company("GeograficNational"), 198032, 17);
            Loan     loanIndividualGerasim            = new Loan(new Individual("Gerasim"), 315, 2);
            Loan     loanCompanyTouristOOD            = new Loan(new Company("TouristOOD"), 43707, 9);
            Mortgage mortgageIndividualPetkan         = new Mortgage(new Individual("Petkan"), 200, 6);
            Mortgage mortgageCompanySoftCom           = new Mortgage(new Company("SoftCom"), 299387, 19);

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

            Bank alianzBank = new Bank("Alianz");

            alianzBank.AddAccount(depositeIndividualStanimir);
            alianzBank.AddAccount(depositeCompanyGeograficNational);
            alianzBank.AddAccount(loanIndividualGerasim);
            alianzBank.AddAccount(loanCompanyTouristOOD);
            alianzBank.AddAccount(mortgageIndividualPetkan);
            alianzBank.AddAccount(mortgageCompanySoftCom);

            Console.WriteLine(alianzBank.ToString());
        }
示例#5
0
        internal static void Main()
        {
            var firstLoan = new Loan(Customer.Companies, 1200, 6);

            firstLoan.CalculateInterestAmount(12);
            firstLoan.DepositMoney(200);
            Console.WriteLine("Current balance is " + firstLoan.Balance);

            var secondLoan = new Loan(Customer.Individuals, 1200, 6);

            secondLoan.CalculateInterestAmount(12);

            var firstDeposit = new Deposit(Customer.Companies, 800, 6);

            firstDeposit.CalculateInterestAmount(12);
            firstDeposit.WithDrawMoney(150);
            Console.WriteLine("Current balance is " + firstDeposit.Balance);

            var secondDeposit = new Deposit(Customer.Individuals, 1200, 6);

            secondDeposit.CalculateInterestAmount(12);
            secondDeposit.DepositMoney(800);
            Console.WriteLine("Current balance is " + secondDeposit.Balance);

            var firstMortgage = new Mortgage(Customer.Companies, 1200, 6);

            firstMortgage.CalculateInterestAmount(12);

            var secondMortgage = new Mortgage(Customer.Individuals, 1200, 6);

            secondMortgage.CalculateInterestAmount(12);
            secondMortgage.DepositMoney(350);
            Console.WriteLine("Current balance is " + secondMortgage.Balance);

            string github = "https://github.com/niksmanov";

            Console.WriteLine(Environment.NewLine + "Source: {0}", github);
        }
示例#6
0
        public static void Main()
        {
            // Some accounts
            Deposite firstDeposite = new Deposite(Customers.Companies, 100000, 1.4m);
            Deposite secondDeposite = new Deposite(Customers.Individuals, 2500, 3.4m);

            Loan firstLoan = new Loan(Customers.Companies, 2400000m, 2.7m);
            Loan secondLoan = new Loan(Customers.Individuals, 7500, 1.001m);

            Mortgage firstMortgage = new Mortgage(Customers.Companies, 12400m, 5.1m);
            Mortgage secondMortgage = new Mortgage(Customers.Individuals, 4500, 0.11m);

            // Add and with draw some money
            firstDeposite.WithDrawMoney(1000.0m);
            secondDeposite.DepositeMoney(1000.0m);
            secondLoan.DepositeMoney(100);
            firstMortgage.DepositeMoney(600);

            // Calculate interests of amount
            decimal firstAmount = firstDeposite.CalculateInterestAmount(12); 
            Console.WriteLine("Interest amount {0:F3} %", firstAmount);

            decimal secondAmount = firstMortgage.CalculateInterestAmount(7);
            Console.WriteLine("Interest amount {0:F3} %\n", secondAmount);

            // Create a bank
            Bank bank = new Bank();

            // Adding some accounts in the bank
            bank.AddDepositeAccount(firstDeposite, secondDeposite);
            bank.AddLoanAccount(firstLoan, secondLoan);
            bank.AddMortgageAccount(firstMortgage, secondMortgage);

            // Print information about all account in the bank
            Console.WriteLine(bank.DepositeAccounts);
            Console.WriteLine(bank.LoanAccounts);
            Console.WriteLine(bank.MortgageAccounts);
        }
示例#7
0
        static void Main()
        {
            var indvCustomer = new Individual("Gosho Doshev");
            var compCustomer = new Company("Gosho Enterprises");

            Console.WriteLine("DEPOSIT TESTS");
            var myDeposit = new Deposit(indvCustomer, 3000, 4.3);

            Console.WriteLine($"The deposit rate for 6 months and 3000 Balance is: {myDeposit.CalculateInterestRate(6)}");
            myDeposit.WithdrawFunds(2500);
            Console.WriteLine($"The deposit rate for 6 months and 500 Balance is: {myDeposit.CalculateInterestRate(6)}");
            Console.WriteLine($"My funds now: {myDeposit.Balance}");
            Console.WriteLine("Deposit 1500");
            myDeposit.DepositFunds(1500);
            Console.WriteLine($"My funds now: {myDeposit.Balance}");
            Console.WriteLine("Withdraw 500");
            myDeposit.WithdrawFunds(500);
            Console.WriteLine($"My funds now: {myDeposit.Balance}");


            Console.WriteLine("\nLOAN TESTS");
            var compLoan = new Loan(compCustomer, 831678, 3.1);

            Console.WriteLine($"Company Load: Loan rate for 1 month -> {compLoan.CalculateInterestRate(1)}, and for 6 months -> {compLoan.CalculateInterestRate(6)}");
            var idvLoan = new Loan(indvCustomer, 1311, 2.1);

            Console.WriteLine($"Individual Load: Loan rate for 2 months -> {idvLoan.CalculateInterestRate(2)}, and for 6 months -> {idvLoan.CalculateInterestRate(6)}");



            Console.WriteLine("\nMORTGAGE TESTS");
            var compMortgage = new Mortgage(compCustomer, 21871, 1.2);
            var idvMortgage  = new Mortgage(indvCustomer, 1232, 4.1);

            Console.WriteLine($"Company Mortgage: Mortgage rate for 11 months -> {compMortgage.CalculateInterestRate(11)}, and for 18 months -> {compMortgage.CalculateInterestRate(18)}");
            Console.WriteLine($"Individual Mortgage: Mortgage rate for 4 months -> {idvMortgage.CalculateInterestRate(2)}, and for 12 months -> {idvMortgage.CalculateInterestRate(6)}");
        }
示例#8
0
        internal static void Main()
        {
            var firstLoan = new Loan(Customer.Companies, 1200, 6);

            firstLoan.CalculateInterestAmount(12);
            firstLoan.DepositMoney(200);
            Console.WriteLine("Current balance is " + firstLoan.Balance);


            var secondLoan = new Loan(Customer.Individuals, 1200, 6);

            secondLoan.CalculateInterestAmount(12);

            var firstDeposit = new Deposit(Customer.Companies, 800, 6);

            firstDeposit.CalculateInterestAmount(12);
            firstDeposit.WithDrawMoney(150);
            Console.WriteLine("Current balance is " + firstDeposit.Balance);

            var secondDeposit = new Deposit(Customer.Individuals, 1200, 6);

            secondDeposit.CalculateInterestAmount(12);
            secondDeposit.DepositMoney(800);
            Console.WriteLine("Current balance is " + secondDeposit.Balance);


            var firstMortgage = new Mortgage(Customer.Companies, 1200, 6);

            firstMortgage.CalculateInterestAmount(12);

            var secondMortgage = new Mortgage(Customer.Individuals, 1200, 6);

            secondMortgage.CalculateInterestAmount(12);
            secondMortgage.DepositMoney(350);
            Console.WriteLine("Current balance is " + secondMortgage.Balance);
        }
        static void Main()
        {
            Account[] bankAccounts = new Account[6];
            bankAccounts[0] = new Deposit("BG13IORT73778100610012",
                new Individual("Deljan", "Stojanov", "Zlatev", "9801062347", "0899745657", "Varna"), 0.007m);
            bankAccounts[0].DepositMoney(900m);
            ((Deposit)bankAccounts[0]).DrawMoney(100m);

            bankAccounts[1] = new Deposit("BG13IORT73778100610000",
                new Company("Dimo DZZD", "457456789", "0897234587", "Sofia"), 0.009m);
            bankAccounts[1].DepositMoney(2000m);

            bankAccounts[2] = new Loan("BG13IORT73778100610032",
                new Individual("Stefan", "Zlatev", "Bojanov", "9801062347", "0899745612", "Sofia"), 0.008m);
            bankAccounts[2].DepositMoney(1000m);

            bankAccounts[3] = new Loan("BG90IORT73778500650000",
                new Company("AAA OOD", "985456789", "0897234587", "Sofia"), 0.009m);
            bankAccounts[3].DepositMoney(1000m);

            bankAccounts[4] = new Mortgage("BG13IORT73778100610078",
                new Individual("Zlatina", "Givkova", "Zlateva", "9801062347", "0899745678", "Varna"), 0.005m);
            bankAccounts[4].DepositMoney(1000m);

            bankAccounts[5] = new Mortgage("BG85IORT73778600660000",
                new Company("BBB EOOD", "478456789", "0897234512", "Varna"), 0.009m);
            bankAccounts[5].DepositMoney(1000m);

            Console.WriteLine("Interest amount is calculated for 12 months:");
            Console.WriteLine();

            foreach (var item in bankAccounts)
            {
                Console.WriteLine("{0} \nInterest: {1:F2}", item, item.CalculateInterestAmount(12));
            }
        }
 static void Main(string[] args)
 {
     Mortgage peshoMortage = new Mortgage(Customer.individual, 25000m, 0.0096m, 69);
     Console.WriteLine(peshoMortage.CalculateInterestAmount());
 }
        public static void MortgageAccountActions()
        {
            Mortgage acc = accounts[2] as Mortgage;

            acc.DepositMoney(306000);
        }