自動(dòng)取款機(jī)源代碼(CandC)(Cand(C))_第1頁(yè)
自動(dòng)取款機(jī)源代碼(CandC)(Cand(C))_第2頁(yè)
自動(dòng)取款機(jī)源代碼(CandC)(Cand(C))_第3頁(yè)
自動(dòng)取款機(jī)源代碼(CandC)(Cand(C))_第4頁(yè)
自動(dòng)取款機(jī)源代碼(CandC)(Cand(C))_第5頁(yè)
已閱讀5頁(yè),還剩35頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

自動(dòng)取款機(jī)源代碼(CandC)(Cand(C))C++and(C).Txtandhandsomemenshakehands,anddeepmentalkaboutheart,andsuccessfulmenmoreexchanges,andordinarymenlive.#include<iostream.h>#include<fstream.h>ttinclude<stdio.h>#include<time.h>ttinclude<string.h>#include<windows.h>StructAcount{Charname[20];Intcardnu;Intcode;DoubleBan;Chartime[26];StructAcountuser;Inti;Void,Welcome()ICout?***?endl;Cout<<**welcomestheuseofthenewprofitbankATM**?endl;Coutくく"*****************************************\n"<<endl;Cout<<"Please,select,your,native,lanuage,くpleaseselectuserlanguage>\n"?endl;Cout?"1.English\n2.,Chinese\n3.Exit<exitsystem>\n"<<endl;Cout<<"Enter,you,choice,<between,Ito,3>":";)Char,*_time(){Time_trawtime;StructTM*timeinfo;Time(&rawtime);Timeinfo=Localtime(&rawtime);Returnasctime(timeinfo);)Intfind(intcard){i=-l;IfstreaminCacount.dat",ios::binary|ios::nocreate);If(...In)Return0;While(...In.eof()){i++;In.read((char*)&user,sizeof(user));If(user.cardnu==card)In.close();Return1;In.close();Return0;)Int,cardnumber2()IIntn;Fstreamfile(accountnumber.Dat,ios::binary|ios::nocreate|ios::in|ios::out);If(...File)(Coutくくcannotopenthisfile"?endl;Return0;N=0;While(…N){File.read((char*)&n,sizeof(int));)Intm=0;File,seekp(-4,ios::cur);File,write((char*)&m,sizeof(int));File,close();Returnn;)Void,print2()(System("CLS");Chartime[25];Strcpy(time,time());Time[24]=,Cout?"AUTOMATICTELLERMACHINE-HENERBANKINGSYSTEM"?endl;Cout?"CARDHOLDERBILLCOPYcardholderstubs"?endl;Cout?〃+ +"<<endl;Cout?"Iterminal||<<endlNo.10203";Cout<<"+ +"<<endl;Cout?"IIauthorizedcreditcard|"?endl;Cout<<"Icard|"<<user.cardnu<<"|"?endl;Cout?"III"?endl;Cout<<"Itransactiontype|bankcardaccount|"?endl;Cout<<"Itrading|198447batches|"?endl;Cout?"Itime/date|"<<time<<"|"?endl;Cout<<+“<<endl;Cout?"CAEDHOLEDERSINATUREIII"?endl;Cout?*Icardholdersignature|<<endl;Cout?〃+ +“<<endl;Cout?"I,ACKNOWLEDGE,SATISFACTORY,RECEIPT,OF,RELATIVE,SERVICES"?endl;Cout<<"Iagreewiththeaboveterms,"<<endl;)Voidprint2(intx)!System("CLS");Chartime[25];Strcpy(time,_time());Time[24]='';Cout?"AUTOMATICTELLERMACHINE-HENERBANKINGSYSTEM"<<endl;Cout?/'CARDHOLDERBILLCOPYcardholderstubs"?endl;Cout<<“+ +"<<endl;Cout<<"Iterminal||<<endlNo.10203";Cout<<“+ +"<<endl;Cout<<"IIauthorizedcreditcard|"?endl;Cout?"Icard|"<<user.cardnu<<"|"?endl;Cout?"III"?endl;If(x>0)Cout?"Itransactiontype|cashdeposit|"?endl;Else{x=-x;Cout?"Itransactiontype|cash|"<<endl;Cout?”Itrading198447batches?endl;Cout<<"+ +〃<<endl;Cout?”Itime/date?time<<?endl;Cout<<"Itransactions<<x<<<<endl;court<<"+ +〃<<endl;courtくく“Icaedholedersinature||"<<endl;court<<"I持卡人簽名II”くくendl;court<く"+ +"<<endl;court<<"iacknowledgesatisfactoryreceiptofrelativeservices"<くendl;court<く"我同意以上條款"くくendl;court<く"按任意鍵返回";cin.get();cin.get();saving2(void)[charch;inttem;court<く”請(qǐng)將現(xiàn)金送到指定入口:“;cin>>tor;user,ban+=tor;fstreamout("acount.dat"ios::in|ios::out|ios::binary).out.seekp(i*sizeof(user),ios::beg);out.write((char*)&user,sizeof(user);out.close();court<<"\t\t\t你已存入"くくくくendltor;sleep(3000).court<く”需要打印憑條嗎?(y=是.n=否):"く<endl;cin>>ch;if(ch=='y'!丨ch=='y')print2(tor).)drawmoney2(void)(charch;inttem;court<く"請(qǐng)輸入所取金額(必須是100的整數(shù)倍):";cin>>tor;while(as%)(court<<"sorry,請(qǐng)重新輸入";cin>>tor;user,ban-=tor;fstreamout("acount.datios::in|ios::out|ios::binary).out.seekp(i*sizeof(user),ios::beg);out.write((char*)&user,sizeof(user);out.close();court<<”請(qǐng)?jiān)?0秒內(nèi)取走現(xiàn)金;"<<<<endltor;sleep(3000).court<く"需要打印憑條嗎?(y=是,n=否):";cin>>ch;if(ch=='y'I1ch=='y')print2(-tor);}change2(void)inttor,j=3;court<く”請(qǐng)輸入你的原密碼”;do{cin>>tor;J-;if(as==user,code){court<く”請(qǐng)輸入你的新密碼:“;cin>>tor;user.code=tor;fstreamout("acount.dat"ios::binary|ios::inios::out);out.seekp(i*sizeof(user),ios::beg);out.write((char*)&user,sizeof(user);out.close();court<<"密碼修改成功,請(qǐng)記下此密碼"くくくくendltor;sleep(2000);court<く”按任意鍵返回”;cin.get();cin.get();)elseCout<<"passworderror,pleasere-enter(youhave"?j?"secondentry")";}while(J);)Void,Select2()!Int,choice,code;Cout<<"pleaseenteryourPINnumber."";Do{Cin>>code;If(user,code-code)Break;ElseCout?passworderror,pleasere-enter”;}while(2);Do(Cout<<"pleaseselectbusinessfunctions",<<endl;Cout<<"1.RMBdepositbusiness\n2.RMBwithdrawalsbusiness\n3.balanceinquiries\n4.modifypassword\n5.return\n"?endl;Cout?"pleaseselect<1to5 ;Do(Cin>>choice;Switch(choice)Case,1:,Saving2();break;Case,2:,Drawmoney2();break;Case3:{cout?”thebalanceonyourcardis:"<<user.Ban?endl;cout<<"pressanykeytoreturn";<<endl;getchar();break;}Case,4:,Change2();break;Case5:return;break;Default:cout<<"theinputisnotvalid.Pleasere-enterit:";)}while(choice>5||choice<l);}while(choice,=5);)Void,TellerMach2(){Inttem;Charch;Do{Cout?"pleaseinsertabankcard(0=cancel):Cin>>tem;If(tem-O)Break;Else[If(find(TEM)=0)(Cout<<"excuseme,thisATMdoesn(tacceptyourbankcard."!(pressFtocontinue,pressanykeytoreturntothepreviouslayer)?endl;Cin>>ch;If(CH,=’ドI|ch=='f')Break;)Else,Select2();}while(1);Void,Management2()Intchoice;Cout<<z,pleaseselectyourbusinessfunction\n\n1.bankcardaccountbusiness\n2.return\n"<<endl;Cout?”pleaseselect<1to2>.":";Do{Cin>>choice;If(choice==2)Return;Elseif(choice==l)(OFSTREAMout("acount.dat",ios;:binary|ios::app);Cout?"pleaseenteryourname.":";Cin>>;User.cardnu=cardnumber2();Cout<<"youraccountnumberis”<<user.cardnu<<endl".;Intn;Cout?"\n,pleaseenteryourpassword(mustbe6bits):Do{Cin>>n;If(n<100000)Cout<<thepasswordisnotenough.Pleasere-enterit:";If(n>999999)“Coutくく“passwordistoolong.Pleasere-enterit:";}while(n<100000||n>999999);User.code=n;User.Ban=10.0;Strcpy(user,time,_time());Out.寫((char*)和用戶,sizeof(用戶));出來(lái)。〇;coutくく“是否打印憑條嗎?(y=是,n=否):”;ch;CIN;如果(CH==Y||CH==Y)print2();coutくく“按任意鍵返回上一層"くくendl;getchar();打破;)其他的coutくく“輸入錯(cuò)誤!請(qǐng)重新輸入:";}(1);國(guó)際cardnumber1()intn;fstream文件(“賬號(hào).dat”,ios::::二進(jìn)制|iOSios::nocreateios::在Iios::out);如果(1文件){coutくく“無(wú)法打開文件"?endl;返回0;)n=0;而(!n)文件讀取((char*)&n,sizeof(int));)整數(shù)m=0;文件。seekp(4,ios::CUR);文件編寫((char*)&M,sizeof(int));文件。〇;返回N;)無(wú)效printl()(系統(tǒng)(“CLS”);字符時(shí)間[25];strcpy(時(shí)間,_time());時(shí)間[24]=;coutくく"自動(dòng)取款機(jī)hener銀行系統(tǒng)"くくendl;coutくく“持卡人的帳單副本持卡人存根”くくendl;cout?"+ +"<<endl;coutくく"I終端IDI10203I"?endl; +”<<endl;coutくく“I卡型I亨利銀行信用卡I”くくendl;coutくく"I卡號(hào)I”くく用戶。cardnuくく"|"くくendl;cout?"III"<<endl;cout?"ITRENS型I開賬戶I”くくendl;coutくく"I批號(hào)I198447I”くくendl;cout?"IIIn<<endl;coutくく“I數(shù)據(jù)/時(shí)間I”くく時(shí)間くく“I”くくendl;cout?“+ +”<<endl;coutくく“Icaedholeder簽名I|"くくendl;coutくく“I持卡人簽名Iド'くくendl;coutくく“+ +”<<endl;coutくく“我承認(rèn)收到相對(duì)滿意的服務(wù)”的くくendl;coutくく“我同意以上條款”くくendl;coutくく“按任何肯退出”;get()CIN;get()CIN;)無(wú)效printl(intx)系統(tǒng)(“CLS”);字符時(shí)間[25];strcpy(時(shí)間,_time());時(shí)間[24]:;coutくく“自動(dòng)取款機(jī)hener銀行系統(tǒng)”くくendl;coutくく“持卡人的帳單副本持卡人存根”くくendl;coutくく“++”?endl;coutくく“I終端IDI10203ドくくendl;cout?"+ +”くくendl;coutくく“I卡型I亨利銀行信用卡I”くくencll;coutくく“I卡號(hào)I”くく用戶。cardnu?"|"くくendl;coutくく"III"くくendl;如果(x>0)coutくく“I反式I押金I”くくendl;其他的{X=x;coutくく"I反式I以現(xiàn)金I”くくendl;)coutくく“I批號(hào)I198447I”くくendl;coutくく"III"くくendl;cout?"I總量I"くくx?"I"?endl; +”<<endl;cout?"Icaedholeder簽名I|”<<endl;coutくく“I持卡人簽名II”くくendl;cout?"+ +”?endl;coutくく“我承認(rèn)收到相對(duì)滿意的服務(wù)”的くくendl;coutくく“我同意以上條款”くくendl;coutくく“按任何肯退出”;get()CIN;get()CIN;}無(wú)效savingl()ch;intTEM;coutくく“請(qǐng)將現(xiàn)金預(yù)約入口:";宮頸上皮內(nèi)瘤變;用戶禁止+=Tem;fstream出來(lái)("count.dat”,ios::inIios::out|ios::binary).out.seekp(i*sizeof(user),ios::beg).out.write((char*)&use,sizeof(user).out.close().i"'\t\t\tyouhavedeposit”くくくくくくくくくくendl.)sleep(3);cost","doyouwanttoprint?(y/n):<<<<<endl.>?.if(ch=='y'IIch=='')printl(tem).drawmoney1(void)charch;intem.ipleaseinputtheamountofmoneeyyouwant(itmustbeisthemutipleof100).>>tem.while(tempercent)ii"sorry,pleaseinputagain.>>tem.)user,banbytem.fstreamout("acount.dat,ios::in|ios::out|ios::binary).out.seekp(i*sizeof(user),ios::beg).out.write((char*)&use,sizeof(user).out.close().cost"pleasetakethecashin30seconds."<<<<<<<<<<endl.)sleep(3);cost","doyouwantaprint?(\n).>?.if(ch=='y'IIch=='')printl(tem).)voidchangel()!intj=3;temiinjoutoriginalpassword”.do{->>tem.if(a==user.code.)ipleaseinputyounewpassword:.->>tem.user,code=tem.fstreamout("acount.dat,ios::in|ios::out|ios::binary).out.seekp(i*sizeof(user),ios::beg).out.write((char*)&use,sizeof(user).out.close().irevisethepasswordsuccessfully,makenoteofthispassword,please""tim"endl.sleep(2000).d=0.“pressanykey"cost"toexit.cin.get().cm.getelseipassworderror,inputagain(youstillhaveiopportunity)selectl(void)Iinchoice,code;i""pleaseinputyourpassword.do{->>codeofconduct;if(user,code==)break;elseipassworderror,inputagain.“⑵.do("cost"andthebusinessfunction("<<endl."cost",bankdepositofrmb\n2.takingthermb\n3.inquirebalance.4.revisethepassword?5. \n""endl.coutくく“請(qǐng)選擇く5>:1間”;做{選擇;開關(guān)(選擇)!案例1:savingl();打破;案例2:drawmoney1();打破;案例3:{coutくく’’你的余額賬戶是:“くく用戶。禁止くくendl;coutくく“按任意鍵退出“くくendl;getchar();break;}案例4:changel();打破;案例5:返回;中斷;默認(rèn)值:coutくく“輸入錯(cuò)誤,請(qǐng)重新輸入:)}而(選擇>5丨|選擇く1);)(選擇)!=5);)無(wú)效tellermachl()Ich;做{coutくく“請(qǐng)插入銀行卡(0=取消):”;>>user,cardnuCIN;如果(用戶。cardnu==0)打破;如果(發(fā)現(xiàn)(用戶。cardnu)==0)coutくく“對(duì)不起,您的信用卡被接受!(按下F鍵繼續(xù),按回車鍵退出)“くくendl;CIN;如果(CH)!=F||CH==F)打破;)其他selectl();)}(1);)無(wú)效management1(){int的選擇;coutくく“請(qǐng)選擇您的業(yè)務(wù)功能、n\n!〇銀行卡賬戶業(yè)務(wù)、n2〇退出\n"<<endl;coutくく"請(qǐng)選擇く1到2>:”;做{選擇;如果(選擇=2)返回;否則如果(選擇=1)I流出來(lái)("count.dat”,ios:::;二進(jìn)制|iOSApp);coutくく"請(qǐng)輸入你的名字:";CIN>>user,name;cardnu=cardnumberl()用戶;coutくく"你的帳號(hào)是"くく用戶cardnu?endl;intn;coutくく"請(qǐng)輸入你的密碼(長(zhǎng)度必須為6);”;CIN;如果(n<100000)coutくく“密碼長(zhǎng)度太短,請(qǐng)?jiān)俅胃淖?“;如果(n>999999)coutくく“密碼長(zhǎng)度太大,請(qǐng)?jiān)俅胃淖?“;)而(n<100000IIn>999999);用戶,代碼

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論