本文整理汇总了C#中Bank.PrintAccounts方法的典型用法代码示例。如果您正苦于以下问题:C# Bank.PrintAccounts方法的具体用法?C# Bank.PrintAccounts怎么用?C# Bank.PrintAccounts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bank
的用法示例。
在下文中一共展示了Bank.PrintAccounts方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main()
{
Bank bank = new Bank("OOP");
// fill in some random records
for (int i = 0; i < numberOfCustomers; i++)
{
Customer client;
if(vladoRandoma.Next() % 2 == 0)
{
client = new Company(companyNames[vladoRandoma.Next(0, companyNames.Length)]);
}
else
{
client = new IndividualCustomer(fnames[i]+" "+ lnames[i]);
}
switch (vladoRandoma.Next() % 3)
{
case 1: bank.AddAccount(new Loan(client, vladoRandoma.Next(100, 10000), vladoRandoma.Next(0, 36))); break;
case 2: bank.AddAccount(new Mortgage(client, vladoRandoma.Next(100, 10000), vladoRandoma.Next(0, 36))); break;
case 0: bank.AddAccount(new Deposit(client, vladoRandoma.Next(100, 10000), vladoRandoma.Next(0, 36))); break;
default:
break;
}
}
bank.PrintAccounts();
foreach (var item in bank.Customers)
{
bank[item.Name].Deposit(500);
}
foreach (var item in bank.Customers)
{
bank[item.Name].Draw(1000);
}
}