欢迎来到天天文库
浏览记录
ID:59313251
大小:40.00 KB
页数:13页
时间:2020-09-05
《银行业务模拟系统.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、#include#include#include#include#include#includeusingnamespacestd;classuser//帐号信息类{private:intnumber;//编号charname[20];//用户名intaccount;//帐号doublemoney;//余额intyear;//开户日期intmonth;intday;inthour;intminute;intsecond;charpasswor
2、d[7];//密码public:voidinit(charn[20],charp[]);//帐号初始化intgetaccount()//获取帐号{returnaccount;}intmatch(charx[])//核对信息{if(strcmp(x,password)==0)return1;return0;}voiddeposit();//存款voidgetmeney();//取款voidtransfer();//转账voidaddingmonech(floatx)//转账加钱{money=money+x;}voidprint();//输出帐号信息voi
3、damandpassword();//修改密码intdeletec();//注销帐号voidmove(){number=number-1;}voidsave();//保存帐户信息voidmenu();//帐号管理主界面};intN=0;usercustomer;//定义全局对象voidloadingmenu();voidinputpassword(charx[]);voidloading();voidopenaccount();voiduser::init(charn[20],charp[]){fstreamf;number=N+1;strcpy(na
4、me,n);srand((int)time(0));if(number==1)account=rand()%90000+10000;else{f.open("bank.txt",ios::in
5、ios::out);account=rand()%90000+10000;for(inti=0;i6、0000;elsebreak;}f.close();}money=0;SYSTEMTIMEst;//系统时间类GetLocalTime(&st);year=st.wYear;month=st.wMonth;day=st.wDay;hour=st.wHour;minute=st.wMinute;second=st.wSecond;strcpy(password,p);cout<7、<<"."<<(month<10?"0":"")<8、退出银行系统)"<>ch;if(ch=='y')menu();elseexit(0);}voiduser::save(){fstreamf;f.open("bank.txt",ios::in9、ios::out);if(f.fail()){cout<<"打开失败!"<10、t()//存款{intm;charch;cout<<"请输入存钱数目:";cin>>m;whi
6、0000;elsebreak;}f.close();}money=0;SYSTEMTIMEst;//系统时间类GetLocalTime(&st);year=st.wYear;month=st.wMonth;day=st.wDay;hour=st.wHour;minute=st.wMinute;second=st.wSecond;strcpy(password,p);cout<7、<<"."<<(month<10?"0":"")<8、退出银行系统)"<>ch;if(ch=='y')menu();elseexit(0);}voiduser::save(){fstreamf;f.open("bank.txt",ios::in9、ios::out);if(f.fail()){cout<<"打开失败!"<10、t()//存款{intm;charch;cout<<"请输入存钱数目:";cin>>m;whi
7、<<"."<<(month<10?"0":"")<8、退出银行系统)"<>ch;if(ch=='y')menu();elseexit(0);}voiduser::save(){fstreamf;f.open("bank.txt",ios::in9、ios::out);if(f.fail()){cout<<"打开失败!"<10、t()//存款{intm;charch;cout<<"请输入存钱数目:";cin>>m;whi
8、退出银行系统)"<>ch;if(ch=='y')menu();elseexit(0);}voiduser::save(){fstreamf;f.open("bank.txt",ios::in
9、ios::out);if(f.fail()){cout<<"打开失败!"<10、t()//存款{intm;charch;cout<<"请输入存钱数目:";cin>>m;whi
10、t()//存款{intm;charch;cout<<"请输入存钱数目:";cin>>m;whi
此文档下载收益归作者所有