注:
该案例为离线案例
该银行atm包括登录,注册功能
atm机里暂时只存储了三个用户的数据
而且有许多地方没有完善,这个案例只完成了大概三分之一
具体代码如下:
/** 银行案例的测试类(程序的起始)**/
public class TestBank {
public static void main(String[]args){
Bank bank = new Bank();//创建了一家银行网点
//显示菜单
bank.welcomeMenu();
}
}
public class User {
private String cardNo;//卡号
private String identity;//身份证号
private String username;//用户名
private String password;//密码
private String phone;//手机号码
private double balance;//余额
public User(){
}
public User(String cardNo , String identity , String username ,
String password , String phone , double balance){
this.cardNo = cardNo;
this.identity = identity;
this.username = username;
this.password = password;
this.phone = phone;
this.balance = balance;
}
public void setCardNo(String cardNo){
this.cardNo = cardNo;
}
public String getCardNo(){
return this.cardNo;
}
public void setIdentity(String identity){
this.identity = identity;
}
public String getIdentity(){
return this.identity;
}
public void setUsername(String username){
this.username = username;
}
public String getUsername(){
return this.username;
}
public void setPassword(String password){
this.password = password;
}
public String getPassword(){
return this.password;
}
public void setPhone(String phone){
this.phone = phone;
}
public String getPhone(