示例#1
0
 public static Debt Create(Bank debtor, float amount, float interest, int months)
 {
     Debt d = new Debt();
     d.Debtor = debtor;
     d.Principal = amount;
     d.Interest = interest;
     d.Months = months;
     return d;
 }
示例#2
0
 public static Loan Create(Bank bank, float amount, float interest, int months, float risk)
 {
     Loan l = new Loan();
     l.Loaner = bank;
     l.Principal = amount;
     l.Interest = interest;
     l.Months = months;
     l.DefaultRisk = risk;
     return l;
 }
 public BankAccount GetBankAccount(string playerName, string accountType)
 {
     return(Bank.GetBankAccount(playerName, accountType));
 }
 public BankAccount GetBankAccount(TSPlayer player, string accountType)
 {
     return(Bank.GetBankAccount(player.Name, accountType));
 }
示例#5
-1
        private static void Main()
        {
            const decimal MonthsOfInterest = 20;
            var obb = new Bank("United Bank of Bulgaria");
            var dimo = new Individual("Dimo Petrov");
            var petar = new Individual("Petar Georgiev");
            var georgi = new Individual("Georgi Gankov");
            var divastoreEood = new Company("DivaStore EOOD");
            var petkoEt = new Company("Petko Jordanov ET");

            Account[] someAccounts =
                {
                    new Loan(2400, 2, petar), new Deposit(10000, 6, divastoreEood), 
                    new Loan(200, 5, divastoreEood), new Mortgage(60000, 5, georgi), 
                    new Deposit(1200, 6, georgi), new Mortgage(1200000, 3, petkoEt), 
                    new Deposit(800, 7, dimo), new Loan(200, 4, dimo)
                };

            obb.AddAccounts(someAccounts);

            // this prints information about all of the accounts in the bank
            Console.WriteLine(obb);

            // this prints the average interest for all of the accounts in the collection of accounts
            Console.WriteLine(
                "The average interest for {0} months is {1}", 
                MonthsOfInterest, 
                obb.AvarageInterestRate(MonthsOfInterest));
        }
示例#6
-1
        public static void Main()
        {
            Bank bank = new Bank("SoftUni Bank");
            var e = bank.Accounts;
            foreach (var account in e)
            {
                Console.WriteLine(account);
            }

            try
            {
                Individual clientOne = new Individual("Pencho Pitankata", "Neyde", "1212121230");
                Company clientTwo = new Company("SoftUni", "Hadji Dimitar", "831251119", true);
                DepositAccount depositOne = new DepositAccount(clientOne, 5, 10000);
                DepositAccount depositTwo = new DepositAccount(clientOne, 2, 100, new DateTime(2000, 01, 01));
                DepositAccount depositThree = new DepositAccount(clientOne, 2, 10000, new DateTime(2008, 01, 01));
                LoanAccount loanOne = new LoanAccount(clientOne, 14, 10000, new DateTime(2003, 01, 01));
                LoanAccount loanTwo = new LoanAccount(clientTwo, 14, 10000, new DateTime(2003, 01, 01));
                MortgageAccount mortgageOne = new MortgageAccount(clientOne, 7, 100000, new DateTime(2013, 08, 01));
                MortgageAccount mortgageTwo = new MortgageAccount(clientTwo, 7, 100000, new DateTime(2014, 08, 01));
                Console.WriteLine("Deposit Account 1 Interest: {0:F2}", depositOne.Interest());
                Console.WriteLine("Deposit Account 2 Interest: {0:F2}", depositTwo.Interest());
                Console.WriteLine("Deposit Account 3 Interest: {0:F2}", depositThree.Interest());
                Console.WriteLine("Loan Account Individual Interest: {0:F2}", loanOne.Interest());
                Console.WriteLine("Loan Account Company Interest: {0:F2}", loanTwo.Interest());
                Console.WriteLine("Mortgage Account Interest: {0:F2}", mortgageOne.Interest());
                Console.WriteLine("Mortgage Account Interest: {0:F2}", mortgageTwo.Interest());
            }
            catch (ArgumentException ex)
            {
                Console.WriteLine(ex.Message + "\n" + ex.StackTrace);
            }
        }
示例#7
-1
 public Initial(Bank bank)
 {
     InitializeComponent();
     sliderSetLoanInterest.Value = 4;
     sliderSetLoanRisk.Value = 0.2;
     sliderDepositsInterest.Value = 1;
     sliderBankingFees.Value = 5;
     m_bank = bank;
 }