为了正常的体验网站,请在浏览器设置里面开启Javascript功能!

「自动取款机源代码(C and C )」

2022-07-11 4页 doc 55KB 0阅读

用户头像 个人认证

is_313217

暂无简介

举报
「自动取款机源代码(C and C )」#include#include<stdio.h>#include#include <string.h>#include \n"\n"<:";}char*_time(){time_trawtime;structtm* timeinfo;time( &rawtime);timeinfo=localtime (&rawtime);returnasctime (timeinfo);}intfind(intcard){i=-1;ifstreamin("acount.dat",ios::binary|ios::nocreate);if(...
「自动取款机源代码(C and C )」
#include#include<stdio.h>#include#include <string.h>#include <windows.h>structAcount{ﻩcharname[20];intcardnu;intcode;ﻩdoubleBan;chartime[26];};structAcountuser;inti;voidWelcome(){cout<<"*ﻩﻩﻩ*"<<endl;ﻩcout<<"*ﻩ»¶Ó­Ê¹ÓÃÐÂÀûÒøÐÐATM»úﻩ*"<\n"<<endl;cout<<" 1.English\n2.ÖÐÎÄ\n3.Exit <Í˳öϵͳ>\n"<:";}char*_time(){time_trawtime;structtm* timeinfo;time( &rawtime);timeinfo=localtime (&rawtime);returnasctime (timeinfo);}intfind(intcard){i=-1;ifstreamin("acount.dat",ios::binary|ios::nocreate);if(!in)ﻩreturn 0;while(!in.eof())ﻩ{i++;ﻩin.read((char*)&user,sizeof(user));ﻩif(user.cardnu==card)ﻩ{in.close();return 1;}}in.close();return 0;}intcardnumber2(){int n;fstreamfile("Õ˺Å.dat",ios::binary|ios::nocreate|ios::in|ios::out);  if(!file)ﻩ  {ﻩcout<<"²»ÄÜ´ò¿ª´ËÎļþ"<>Tem;ﻩuser.Ban+=Tem;fstreamout("acount.dat",ios::in|ios::out|ios::binary);ﻩout.seekp(i*sizeof(user),ios::beg);  out.write((char*)&user,sizeof(user));ﻩout.close();cout<<"\t\t\tÄãÒÑ´æÈë"<<Tem<>ch;if(ch=='y'||ch=='Y')print2(Tem); }voidDrawmoney2(){charch; intTem;ﻩcout<<"ÇëÊäÈëËùÈ¡½ð¶î£¨±ØÐëÊÇ100µÄÕûÊý±¶£©:";ﻩ ﻩﻩcin>>Tem;while(Tem%100){ﻩﻩﻩcout<<"Sorry,ÇëÖØÐÂÊäÈë";ﻩﻩﻩcin>>Tem;ﻩﻩ}ﻩﻩﻩuser.Ban-=Tem;  fstream out("acount.dat",ios::in|ios::out|ios::binary);ﻩout.seekp(i*sizeof(user),ios::beg);out.write((char*)&user,sizeof(user));out.close();cout<<"ÇëÔÚ30ÃëÄÚÈ¡×ßÏÖ½ð;"<>ch;ﻩif(ch=='y'||ch=='Y')print2(-Tem);}voidChange2(){inttem,j=3;cout<<"ÇëÊäÈëÄãµÄÔ­ÃÜÂë";do{cin>>tem;ﻩ j--;  if(tem==user.code)ﻩ { cout<<"ÇëÊäÈëÄãµÄÐÂÃÜÂ룺";ﻩﻩ cin>>tem;ﻩuser.code=tem; fstreamout("acount.dat",ios::binary|ios::in|ios::out);ﻩout.seekp(i*sizeof(user),ios::beg);   out.write((char*)&user,sizeof(user)); out.close();cout<<"ÃÜÂëÐ޸ijɹ¦£¬Çë¼ÇÏ´ËÃÜÂë "<<tem<<endl;ﻩSleep(2000);ﻩj=0;ﻩcout<<"°´ÈÎÒâ¼ü·µ»Ø";ﻩcin.get();ﻩcin.get();  } elseﻩcout<<"ÃÜÂë´íÎóÇëÖØÐÂÊäÈë(Ä㻹ÓÐ"<<j<<"´ÎÊäÈë»ú»á)"; }while(j);} voidSelect2(){ﻩintchoice,code;cout<<"ÇëÊäÈëÄãµÄÃÜÂë ";do{  cin>>code;ﻩ if(user.code==code)  break;elseﻩcout<<"ÃÜÂë´íÎó£¬ÇëÖØÐÂÊäÈë";ﻩ}while(2);doﻩ{ﻩcout<<"ÇëÑ¡ÔñÒµÎñ¹¦ÄÜ"< :";do{cin>>choice;ﻩswitch(choice)ﻩ{ﻩﻩcase1:Saving2(); break;ﻩcase2: Drawmoney2();break;case3:{cout<<"Ä㿨ÉϵÄÓà¶îΪ:"<<user.Ban<>tem;if(tem==0)ﻩ  break;ﻩﻩelseﻩﻩﻩ{ﻩﻩif(find(tem)==0)ﻩﻩ{ﻩﻩﻩﻩcout<<"¶Ô²»Æ𣬱¾ATM»ú²»½ÓÊÜÄãµÄÒøÐп¨£¡£¨°´F¼ü¼ÌÐø£¬°´ÈÎÒâ¼ü·µ»ØÉÏÒ»²ã£©"<>ch;ﻩﻩﻩ if(ch!='F'||ch=='f')   break;  ﻩﻩﻩ}else Select2();ﻩ}ﻩ  }while(1);}voidManagement2(){ﻩintchoice;cout<<"ÇëÑ¡ÔñÄãµÄÒµÎñ¹¦ÄÜ\n\n1. ÒøÐп¨¿ª»§ÒµÎñ\n2. ·µ»Ø\n"<<endl;cout<<"ÇëÑ¡Ôñ<1 µ½ 2>:";do{ﻩﻩcin>>choice;ﻩﻩif(choice==2)ﻩﻩﻩreturn;ﻩelseif(choice==1)ﻩ{ﻩofstreamout("acount.dat",ios::binary|ios::app);ﻩﻩcout<<"ÇëÊäÈëÄãµÄÐÕÃû£º";ﻩﻩcin>>user.name;ﻩuser.cardnu=cardnumber2();ﻩﻩcout<<"ÄãµÄÕ˺ÅÊÇ"<>n;        if(n<100000)ﻩcout<<"ÃÜÂëλÊý²»¹»£¬ÇëÖØÐÂÊäÈ룺";ﻩﻩif(n>999999)ﻩﻩcout<<"ÃÜÂë¹ý³¤£¬ÇëÖØÐÂÊäÈ룺";ﻩﻩ}while(n<100000||n>999999);ﻩ ﻩﻩﻩuser.code=n;ﻩﻩuser.Ban=10.0;ﻩﻩstrcpy(user.time,_time());ﻩﻩout.write((char*)& user,sizeof(user));ﻩﻩout.close();ﻩﻩcout<<"ÊÇ·ñ´òӡƾÌõÂð£¿(y=ÊÇ£¬n =·ñ)£º";ﻩﻩcharch;ﻩﻩcin>>ch;ﻩﻩif(ch=='y'||ch=='Y')ﻩﻩﻩﻩprint2();cout<<"°´ÈÎÒâ¼ü·µ»ØÉÏÒ»²ã"<0) cout<<"|  TRANS TYPEﻩ  | DEPOSITCASH   |"<>Tem; ﻩuser.Ban+=Tem;  fstreamout("acount.dat",ios::in|ios::out|ios::binary);ﻩout.seekp(i*sizeof(user),ios::beg);out.write((char*)&user,sizeof(user));out.close();cout<<"\t\t\tYouhavedeposit "<<Tem<<endl;ﻩSleep(3000);ﻩcout<<"Doyouwanttoprint£¿(Y/N)£º"<<endl;ﻩcin>>ch;if(ch=='y'||ch=='Y')print1(Tem); }voidDrawmoney1(){  charch;int Tem;ﻩcout<<" Pleaseinputtheamount ofmoneeyyouwant(itmust beisthe mutipleof100):"; ﻩcin>>Tem;ﻩﻩwhile(Tem%100){ﻩﻩcout<<"Sorry,Please inputagain";ﻩﻩcin>>Tem;ﻩﻩ}ﻩﻩuser.Ban-=Tem;fstreamout("acount.dat",ios::in|ios::out|ios::binary);ﻩout.seekp(i*sizeof(user),ios::beg);out.write((char*)&user,sizeof(user));out.close();cout<<"Please takethe cashin30 seconds;"<>ch;if(ch=='y'||ch=='Y')ﻩprint1(-Tem);}voidChange1(){inttem,j=3;cout<<"Please injoutyou originalpassword";do{ﻩcin>>tem;j--;  if(tem==user.code) {ﻩcout<<"Pleaseinputyounewpassword£º";ﻩﻩ  cin>>tem;ﻩ  user.code=tem; ﻩﻩfstreamout("acount.dat",ios::in|ios::out|ios::binary);ﻩout.seekp(i*sizeof(user),ios::beg);   out.write((char*)&user,sizeof(user));ﻩ out.close();ﻩﻩcout<<"Revise the passwordsuccessfully,makenoteofthispasswordplease "<>code;ﻩﻩif(user.code==code)ﻩﻩ break;ﻩﻩ elseﻩﻩﻩcout<<"Passworderror ,inputagain ";ﻩ}while(2);doﻩ{cout<<"Choose thebusiness functionplease"<<endl;ﻩcout<<"1.Bank depositofRMB\n 2. TakingRMB\n3. inquire balance\n4. Revise thepassword\n5.exit\n"<<endl;ﻩcout<<"Pleasechoosebettween<1to5>:";ﻩdo{ﻩﻩcin>>choice;ﻩﻩswitch(choice){ﻩcase1:Saving1();break;case2:Drawmoney1();break;ﻩﻩcase 3:{ cout<<"Yourbalanceofacountis:"<<user.Ban<5||choice<1);ﻩ}while(choice!=5);ﻩ}void TellerMach1(){ﻩchar ch;ﻩdo{ﻩcout<<"Pleaseinsertthe bank card£¨0=cancel£©:";ﻩcin>>user.cardnu;ﻩif(user.cardnu==0)ﻩﻩ break;ﻩﻩelseﻩ{ﻩﻩ  if(find(user.cardnu)==0)ﻩﻩ{ﻩcout<<"Sorry£¬yourcardisaccepted£¡£¨Press Ftocontinue£¬Pressenter toexit£©"<<endl;ﻩ  cin>>ch;ﻩﻩif(ch!='F'||ch=='f')     break;ﻩ    ﻩ}ﻩﻩelseSelect1();}ﻩ ﻩ }while(1);}  voidManagement1(){ﻩintchoice;cout<<"Please chooseyourbusinessfunctions\n\n1.BankCardAccountBusiness\n2.Exit\n"<:";ﻩdo{ﻩcin>>choice;ﻩﻩif(choice==2)ﻩreturn;elseif(choice==1)ﻩ{ﻩofstream out("acount.dat",ios::binary|ios::app); cout<<"Pleaseinputyour name£º";ﻩﻩﻩcin>>user.name;ﻩﻩuser.cardnu=cardnumber1();ﻩﻩﻩcout<<"Your acountis"<>n;    if(n<100000)ﻩﻩﻩcout<<"The lengthofpasswordistooshort,pleasechangeagain£º";ﻩﻩﻩif(n>999999)ﻩﻩﻩﻩcout<<"Thelengthofpasswordistoolarge,please changeagain£º";ﻩﻩ}while(n<100000||n>999999);ﻩﻩ  ﻩﻩuser.code=n;ﻩﻩuser.Ban=10.0;ﻩstrcpy(user.time,_time());out.write((char*)&user,sizeof(user));out.close();ﻩcout<<"Doyouwanttoprint£¿(y/n )£º";ﻩcharch;ﻩcin>>ch;ﻩﻩif(ch=='y'||ch=='Y')ﻩﻩprint1();    cout<<"Pressanykey to exit"<<endl;ﻩﻩgetchar();ﻩ break;}ﻩelseﻩcout<<"inputerror, pleaseinputagain:";}while(1) ;  } voidChinese(){ﻩ intchoice;ﻩdo{ﻩcout<<"\n\nÇëÑ¡ÔñÄãµÄģʽ\n"<<endl;ﻩﻩcout<<" 1.ATM¹ñÔ±»ú\n2.ÒøÐÐÒµÎñ¹ÜÀí\n3.°ïÖú\n  4.·µ»Ø\n"<:";ﻩﻩﻩdo{ﻩcin>>choice; switch(choice){ﻩﻩﻩ case 1 :TellerMach2();break;ﻩﻩﻩﻩ case2: Management2(); break;ﻩﻩcase3 :{cout<<"Äã±ØÐëÏÈÔÚ ¡°ÒøÐÐÒµÎñ¹ÜÀí¡±À↑»§²ÅÄÜʹÓñ¾È¡¿î»ú£¬°´ÈÎÒâ¼ü·µ»Ø";cin.get();cin.get();break;}ﻩﻩﻩcase 4 : {   return ;break;}ﻩdefault:cout<<"ÊäÈë²»ºÏ·¨£¬ÇëÖØÐÂÊäÈë:";ﻩﻩﻩ}  if(choice==3)ﻩﻩﻩcout<<"\nÊäÈëÄãµÄÑ¡Ôñ£º";ﻩ}while(choice!=1&&choice!=2); }while(1);ﻩ ﻩ }ﻩﻩﻩﻩﻩ voidEnglish(){ﻩ int choice;ﻩdo{ﻩcout<<"\n\nPleaseinput patten\n"<<endl;ﻩcout<<"1.ATM\n 2.Banking Management\n3.Help\n4.Exit\n"<>choice;ﻩswitch(choice)ﻩ{ﻩﻩ case 1:TellerMach1();break;case2:Management1();break; case3: { cout<<"Youmustopenaacountin¡¶BankingManagement¡·before youusetheATM,Pressanykeytocontinue";cin.get();cin.get();break;}ﻩﻩﻩﻩcase4:{return;break;}ﻩﻩdefault:cout<<"inputerror£¬Please inoutagain";ﻩﻩ}   if(choice==3)ﻩﻩcout<<"\nPlease your choice £º";ﻩﻩﻩﻩ}while(choice!=1&&choice!=2);ﻩ}while(1);    ﻩ}ﻩﻩﻩintmain(){ﻩWelcome(); intchoice; do{ﻩcin>>choice;   ﻩif(choice==3)ﻩbreak;ﻩ elseif(choice==1)ﻩEnglish(); ﻩelse if(choice==2)Chinese();ﻩelsecout<<"ÊäÈë´íÎó£¬ÇëÖØÐÂÊäÈ룺"; }while(choice!=1&&choice!=2);system("cls");cout<<"\n\n\n\n\t\t\t·Ç³£¸ÐлÄãµÄʹÓÃ!!\n"<
/
本文档为【「自动取款机源代码(C and C )」】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索