📄 bank.cs
字号:
using System;
using System.Collections.Generic;
using System.Text;
namespace ATM
{
class Bank
{
protected const int MaxAccountNum = 2048;
protected string name;
protected int usedAccountNum;
protected Account[] accounts;
public string Name
{
get
{
return name;
}
}
public Bank(string name)
{
this.name = name;
this.usedAccountNum = 0;
accounts = new Account[MaxAccountNum];
}
public bool LoginAccount(string name, string password, out Account account)
{
account = null;
for (int i = 0; i < usedAccountNum; ++i)
{
if (accounts[i].Login(name, password))
{
account = accounts[i];
return true;
}
}
return false;
}
public bool OpenAccount(string name, string password, out Account account)
{
account = null;
for (int i = 0; i < usedAccountNum; ++i)
{
if (accounts[i].Name == name)
return false;
}
account = new Account(name, password);
accounts[usedAccountNum++] = account;
return true;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -