/***程序名:ATM2.0*作者:赵强*学号:11031731*地点:哈尔滨学院2号教学楼8楼*时间:2013年10月18号*/packagecn.zq.atm;importjava.util.LinkedList;publicclassBank{//定义存储用户的链表结构staticLinkedListBankCustomerlist=newLinkedListBankCustomer();//显示首界面staticvoidinterFace(){System.out.println(******************);System.out.println(管理员进入请按1);System.out.println(用户进入请按2);System.out.println(退出请按3);System.out.println(******************);}//显示管理员界面staticvoidinterFace1(){System.out.println(******************);System.out.println(增加用户请按1);System.out.println(删除用户请按2);System.out.println(查询用户请按3);System.out.println(查询所有用户请按4);System.out.println(打印银行余额请按5);System.out.println(退出请按6);System.out.println(******************);}//显示用户界面staticvoidinterFace2(){System.out.println(******************);System.out.println(存款请按1);System.out.println(取款请按2);System.out.println(查询余额请按3);System.out.println(转账请按4);System.out.println(修改密码请按5);System.out.println(退出请按6);System.out.println(******************);}//定义原始用户static{list.add(newBankCustomer(1001,张三,1001,100,false));list.add(newBankCustomer(1002,李四,1002,100,false));list.add(newBankCustomer(1003,王五,1003,100,false));list.add(newBankCustomer(1004,赵六,1004,100,false));list.add(newBankCustomer(1005,田七,1005,100,true));}}/***程序名:ATM2.0*作者:赵强*学号:11031731*地点:哈尔滨学院2号教学楼8楼*时间:2013年10月18号*/packagecn.zq.atm;importjava.util.Scanner;publicclassBankCustomer{intid;//定义卡号Stringusername;//定义用户名Stringpassword;//定义密码doublecount;//定义存款余额booleangrade;//定义用户等级//构造函数publicBankCustomer(intid,Stringusername,Stringpassword,doublecount,booleangrade){super();this.id=id;this.username=username;this.password=password;this.count=count;this.grade=grade;}publicintgetId(){returnid;}publicvoidsetId(intid){this.id=id;}publicStringgetUsername(){returnusername;}publicvoidsetUsername(Stringusername){this.username=username;}publicStringgetPassword(){returnpassword;}publicvoidsetPassword(Stringpassword){this.password=password;}publicdoublegetCount(){returncount;}publicvoidsetCount(doublecount){this.count=count;}publicbooleangetGrade(){returngrade;}publicvoidsetGrade(booleangrade){this.grade=grade;}//存款voidsaveMoney(intid){Scannerscan=newScanner(System.in);for(BankCustomerbc:Bank.list){if(bc.getId()==id){/*System.out.println(用户信息如下:);System.out.println(卡号:+id+用户名+bc.getUsername()+等级+Boolean.toString(bc.getGrade()));*/System.out.println(请输入要存的金额:);doublenewAddCount=scan.nextDouble();doublecount=bc.getCount();count+=newAddCount;bc.setCount(count);System.out.println(存款成功!);}}}//普通用户取款voidgetMoney(intid){Scannerscan=newScanner(System.in);for(BankCustomerbc:Bank.list){if(bc.getId()==id){doublecount=bc.getCount();System.out.println(请输入要取的金额:);doublereduceCount=scan.nextDouble();count-=reduceCount;if(count0){System.out.println(取款过多,请重试!);}else{bc.setCount(count);System.out.println(取款成功!);}}}}//VIP用户取款voidgetVipMoney(intid){Scannerscan=newScanner(System.in);for(BankCustomerbc:Bank.list){if(bc.getId()==id){doublecount=bc.getCount();System.out.println(请输入要取的金额(可透支5000):);doublereduceCount=scan.nextDouble();count-=reduceCount;if(count-5000){System.out.println(取款过多,请重试!);}else{bc.setCount(count);System.out.println(取款成功!);}}}}//查询余额voidquery(intid){for(BankCustomerbc:Bank.list){if(bc.getId()==id){System.out.println(你的存款金额是:);System.out.println(bc.getCount());}}}//转账帮手voidtransferHelp(intid,doubletransferMoney){Scannerscan=newScanner(System.in);booleanflag1=true;for(BankCustomerbc:Bank.list){if(bc.getId()==id){System.out.println(用户信息如下:);System.out.println(卡号:+id+用户名+bc.getUsername());flag1=false;booleanflag=false;System.out.println(确定要转账请按1,不转请按2:);intflagId=scan.nextInt();if(flagId==1){flag=true;}if(flag){doublecount=bc.getCount();count+=transferMoney;bc.setCount(count);System.out.println(转账成功!);}else{System.out.println(已终止转账操作!);}}}if(flag1&&Bank.list.getFirst().getId()!=id){System.out.println(没有此用户,请重试!);}}//普通用户转账voidtransfer(intid){Scannerscan=newScanner(System.in);for(BankCustomerbc:Bank.list){if(bc.getId()==id){System.out.println(你要转账的金额是:);inttransferMoney=scan.nextInt();doublecount=bc.getCount();if(transferMoney=count){bc.setCount(count-transferMoney);System.out.println(你要转入的账户是:);inttransferId=scan.nextInt();transferHelp(transferId,transferMoney);}else{System.out.println(金额不足,转账失败,请重试!);}}}}//VIP用户转账voidvipTransfer(intid){Scannerscan=newScanner(System.in);for(BankCustomerbc:Bank.list){if(bc.getId()==id){System.out.println(你要转账的金额是:);inttransferMoney=scan.nextInt();doublecount=bc.getCount();if(transferMoney=count+5000){bc.setCount(count-transferMoney);System.out.println(你要转入的账户是:);inttransferId=scan.nextInt();transferHelp(transferId,transferMoney);}else{System.out.println(金额不足,转账失败,请重试!);}}}}//修改密码voidmodifyPassword(intid){Scannerscan=newScanner(System.in);for(BankCustomerbc:Bank.list){if(bc.getId()==id){System.out.println(你的新密码是:);StringnewPassword=scan.next();bc.setPassword(newPassword);System.out.println(密码修改成功!);}}}}/***程序名:ATM2.0*作者:赵强*学号:11031731*地点:哈尔滨学院2号教学楼8楼*时间:2013年10月18号*/packagecn.zq.atm;importjava.util.Iterator;importjava.util.Scanner;publicclassBankManager{st