欢迎来到天天文库
浏览记录
ID:47675764
大小:155.04 KB
页数:12页
时间:2019-10-19
《碟行客户信息管理系统_C》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、#include#include#includeusingnamespacestd;classChain_belt;classClient//会员类{public:Client*p;voidinput_l(Client*hand)//手动录入{Client*pl;n:cout«,,number=n;cin»number;for(pl=hand;pl->p!=NULL;p1=pl->p){if(p1->number==number){cout«n此编码已存在"«endl;goton;}}cout«Hname=
2、M;cin»name;cout«usex=n;cin»sex;cout«Hage=M;cin»age;cout«^'job=^^;cin»job;cout«nbankroll=H;cin»bankroll;cout«nyear=M;cin»year;cout«nmonth=H;cin»month;cout«Hday=H;cin»day;cout«endl;}intinput()//自动录入cout«n错误n«endl;abort();}ofile»number;if(number==u-1"
3、
4、number5、ofile»name»sex»age»job»bankroll»year»month»day;return1;}}voidinput_2()//第一次录入{cout«Hnumber=H;cin»number;cout«nname=u;cin»name;cout«nsex=M;cin»sex;cout«nage=M;cin»age;cout«ujob=n;cin»job;cout«,,bankroll=M;cin»bankroll;cout«uyear=M;cin»year;cout«Hmonth=n;cin»month;cout«"day=H;cin»day;6、cout«endl;}stringget_numbe「()〃获得number{returnnumber;voiddisplayOcoutvvnumber«Hn«name«Hu«sex«HH«age«Hu«bankroll«HH«year«HH«month«uir«day«n°«endl;}voidamend_bankroll(stringi)〃修改bankroll{intk;if(bankroll7、ebankroll—;}char*get_name()〃获得name{returnname;}intget_age()//获得age{returnage;}intgel_monlh()〃获得month{returnmonth;}intget_bankroll(){returnbankroll;}friendvoidsave(Client*hand);〃保存功能private:stringnumber;charname[20];charsex;intage;charjob[10J;intbankroll;//资金intyear;intmonth;intday;i8、ntdata;//数据staticifstreamofile;//输入流静态成员,保证每次调用input()时,指针地址不会改变};ifstreamClient::ofile("chenmeiling.txt",ios::in);classChain_belt//链表类{public:Client*set_array()//建立初级链表{Client*hand,*pl;inti;hand=newClient;i=hand->input();if(i==0)hand->input_2();//第一次录入p1=newClient;hand->p=p1;pl->p=9、NULL;returnhand;}Client*cut_in(Client&b,Client*handl)//插入{Client*pl,*p2;stringi;p1=hand1;p2=handl;for(i==,,0H;pl->p!=NULL;i==i+nr,){if(i=="0"&&p1->get_number()>b.get_number())//处理头链{b.p=handl;handl=&b;ji=ji+T;break;elseif(p1->get_number()>b.get_number())//处理中间{p2->p=&b;b.p二pl;ji=ji+10、T;break;}elseif(i==
5、ofile»name»sex»age»job»bankroll»year»month»day;return1;}}voidinput_2()//第一次录入{cout«Hnumber=H;cin»number;cout«nname=u;cin»name;cout«nsex=M;cin»sex;cout«nage=M;cin»age;cout«ujob=n;cin»job;cout«,,bankroll=M;cin»bankroll;cout«uyear=M;cin»year;cout«Hmonth=n;cin»month;cout«"day=H;cin»day;
6、cout«endl;}stringget_numbe「()〃获得number{returnnumber;voiddisplayOcoutvvnumber«Hn«name«Hu«sex«HH«age«Hu«bankroll«HH«year«HH«month«uir«day«n°«endl;}voidamend_bankroll(stringi)〃修改bankroll{intk;if(bankroll7、ebankroll—;}char*get_name()〃获得name{returnname;}intget_age()//获得age{returnage;}intgel_monlh()〃获得month{returnmonth;}intget_bankroll(){returnbankroll;}friendvoidsave(Client*hand);〃保存功能private:stringnumber;charname[20];charsex;intage;charjob[10J;intbankroll;//资金intyear;intmonth;intday;i8、ntdata;//数据staticifstreamofile;//输入流静态成员,保证每次调用input()时,指针地址不会改变};ifstreamClient::ofile("chenmeiling.txt",ios::in);classChain_belt//链表类{public:Client*set_array()//建立初级链表{Client*hand,*pl;inti;hand=newClient;i=hand->input();if(i==0)hand->input_2();//第一次录入p1=newClient;hand->p=p1;pl->p=9、NULL;returnhand;}Client*cut_in(Client&b,Client*handl)//插入{Client*pl,*p2;stringi;p1=hand1;p2=handl;for(i==,,0H;pl->p!=NULL;i==i+nr,){if(i=="0"&&p1->get_number()>b.get_number())//处理头链{b.p=handl;handl=&b;ji=ji+T;break;elseif(p1->get_number()>b.get_number())//处理中间{p2->p=&b;b.p二pl;ji=ji+10、T;break;}elseif(i==
7、ebankroll—;}char*get_name()〃获得name{returnname;}intget_age()//获得age{returnage;}intgel_monlh()〃获得month{returnmonth;}intget_bankroll(){returnbankroll;}friendvoidsave(Client*hand);〃保存功能private:stringnumber;charname[20];charsex;intage;charjob[10J;intbankroll;//资金intyear;intmonth;intday;i
8、ntdata;//数据staticifstreamofile;//输入流静态成员,保证每次调用input()时,指针地址不会改变};ifstreamClient::ofile("chenmeiling.txt",ios::in);classChain_belt//链表类{public:Client*set_array()//建立初级链表{Client*hand,*pl;inti;hand=newClient;i=hand->input();if(i==0)hand->input_2();//第一次录入p1=newClient;hand->p=p1;pl->p=
9、NULL;returnhand;}Client*cut_in(Client&b,Client*handl)//插入{Client*pl,*p2;stringi;p1=hand1;p2=handl;for(i==,,0H;pl->p!=NULL;i==i+nr,){if(i=="0"&&p1->get_number()>b.get_number())//处理头链{b.p=handl;handl=&b;ji=ji+T;break;elseif(p1->get_number()>b.get_number())//处理中间{p2->p=&b;b.p二pl;ji=ji+
10、T;break;}elseif(i==
此文档下载收益归作者所有