public class BankTest {
public static void main(String[] args) {//因为是测试类 所以要用到Main方法 否则无法运行结果
Bank bank = new Bank("中国银行");//银行
BankUtils bkUtils = new BankUtils();//Utils类
DataBase database = new DataBase();//数据类
Admin [] admins = database.getAdmin();//管理员账号 密码
Customer [] customers = database.getCostomer();//方法类
Admin admin = new Admin();
Customer customer = new Customer();
BankSysMethod bkSysMethod = new BankSysMethod();
BankCustomerMethod bkCustomerMethod = new BankCustomerMethod();
//这里判断是否退出
Boolean isExit = true;
do {
//运行界面
System.out.println("Welcome to the use "+bk.getName()+"系统,请根据你的需求选择你需要的操作");
System.out.println("请选择你的登录模式:1.管理员登陆 ,2.用户登陆,3.还是退出");
//获取输入的int类型的值
int selectMenu = bkUtils.getReadInt();
switch (selectMenu) {
case 1:
//1、管理员登陆验证,并且把登录的管理员的返回
admin = bkSysMethod.sysRootDengLu(admins);
if(admin == null) {
return;
}
System.out.println(admin);
bkSysMethod.sysRootMethod(customers);
break;
case 2:
customer = bkCustomerMethod.sysCustomerDengLu(customers);
if(customer == null) {
return;
}
bkCustomerMethod.bankCustomerMethod(customers);
System.out.println("用户登陆成功");
break;
case 3:
isExit = false;
System.out.println("退出成功");
break;
default:
System.out.println("你的输入有误,请重新输入!!!");
break;
}
} while (isExit);//直接结束
}
}
JAVA银行管理主程序测试类Test的创建
最新推荐文章于 2022-09-22 20:46:54 发布