ImageVerifierCode 换一换
格式:DOCX , 页数:29 ,大小:20.68KB ,
资源ID:9267271      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/9267271.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(C++课程设计 房屋交易系统.docx)为本站会员(b****7)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

C++课程设计 房屋交易系统.docx

1、C+课程设计 房屋交易系统# define NULL 0# include# include# include# include# include/定义?house类class housepublic: house *next; char *Getadd() return add; char *Getstyle() return style; int Getarea() return area; int Getprice() return price; int Gethouseage() return houseage; char *Getstate() return state; void

2、set_information(char *Nadd,char *Nstyle,int Narea,int Nprice,int Nhouseage,char *Nstate) strcpy(add,Nadd); strcpy(style,Nstyle); area=Narea; price=Nprice; houseage=Nhouseage; strcpy(state,Nstate); private: char add40; char style10; int area; int price; int houseage; char state10;/定义?用?户类class userpu

3、blic: user *next; char *Getname()return name; int GetID()return ID; int Getpassword()return password; void set_information(char *Nname,int id,int passcode) strcpy(name,Nname); ID=id; password=passcode; private: char name20; int ID; int password;/定义?管理员类class managerpublic: manager *next; char *Getna

4、me()return name; int GetID()return ID; int Getpassword()return password; void set_information(char *Nname,int id,int passcode) strcpy(name,Nname); ID=id; password=passcode; private: char name20; int ID; int password;/按地?址查询房?屋Y的?信?息void search_house() char ch40; int sum=0; house *head,*q,*p=new hous

5、e; head=p; char add40; char style10; int area; int price; int houseage; char state10; ifstream file(D:house_information.txt); do coutch; fileaddstyleareapricehouseagestate; p-set_information(add,style,area,price,houseage,state); q=p; while(!file.eof() p=new house; fileaddstyleareapricehouseagestate;

6、 p-set_information(add,style,area,price,houseage,state); q-next=p; q=p; q-next=NULL; file.close(); p=head; while(p!=NULL) if(strcmp(p-Getadd(),ch)=0) sum+; p=p-next; if(sum=0) cout对?不?起e,?信?息库a中D没?有D与?您输?入?的?房?屋Y地?址匹配?的?房?屋Y信?息!?请?重?新?输?入?-Getadd(),ch)=0) coutsetw(40)地?址setw(10)户型setw(10)面?积ysetw(10

7、)价?格?setw(10)房?龄?setw(10)状态?endl; coutsetw(40)Getadd()setw(10)Getstyle()setw(10)Getarea()setw(10)Getprice()setw(10)Gethouseage()setw(10)Getstate()next; while(sum=0);/删?除y房?屋Y信?息void delete_house() char ch40; house *head,*q,*p=new house; head=p; char add40; char style10; int area; int price; int hous

8、eage; char state10; int sum=0; ifstream file1(D:house_information.txt); do coutch; file1addstyleareapricehouseagestate; p-set_information(add,style,area,price,houseage,state); q=p; while(!file1.eof() p=new house; file1addstyleareapricehouseagestate; p-set_information(add,style,area,price,houseage,st

9、ate); q-next=p; q=p; q-next=NULL; file1.close(); p=head; while(p!=NULL) if(strcmp(p-Getadd(),ch)=0) q-next=p-next; delete p; sum+; p=p-next; if(sum=0) cout对?不?起e,?信?息库a中D没?有D与?您输?入?的?房?屋Y地?址匹配?的?房?屋Y信?息!?请?重?新?输?入?-endl; else ofstream file2(D:house_information.txt); p=head; while(p!=NULL) file2Getad

10、d()tGetstyle()tGetarea()tGetprice()tGethouseage()tGetstate()next; q-next=NULL; file2.close(); while(sum=0);/增?加一?条?新?的?房?屋Y信?息void add_house() char add40; char style10; int area; int price; int houseage; char state10; coutaddstyleareapricehouseagestate; ofstream file(D:house_information.txt,ios:app)

11、; filenaddtstyletareatpricethouseagetstate; file.close();/修T改?房?屋Y信?息void modify_house() char ch40; int sum=0; do coutch; house *head,*q,*p=new house; head=p; char add40; char style10; int area; int price; int houseage; char state10; int sum=0; ifstream file1(D:house_information.txt); file1addstylea

12、reapricehouseagestate; p-set_information(add,style,area,price,houseage,state); q=p; while(!file1.eof() p=new house; file1addstyleareapricehouseagestate; p-set_information(add,style,area,price,houseage,state); q-next=p; q=p; q-next=NULL; file1.close(); p=head; while(p!=NULL) if(strcmp(p-Getadd(),ch)=

13、0) strcpy(add,p-Getadd(); strcpy(style,p-Getstyle(); area=p-Getarea(); price=p-Getprice(); houseage=p-Gethouseage(); strcpy(state,p-Getstate(); char choice; do cout请?输?入?您想?要a修T改?的?信?息:on; coutchoice; switch(choice) case a: case A:coutprice;break; case b: case B:couthouseage;break; case c: case C:co

14、utstate;break; default:cout对?不?起e,?您输?入?的?指?令?不?正y确!?请?重?新?输?入?-set_information(add,style,area,price,houseage,state); sum+; p=p-next; if(sum=0) cout对?不?起e,?信?息库a中D没?有D与?您输?入?的?房?屋Y地?址匹配?的?房?屋Y信?息!?请?重?新?输?入?-endl; else ofstream file2(D:house_information.txt); p=head; while(p!=NULL) file2Getadd()tGet

15、style()tGetarea()tGetprice()tGethouseage()tGetstate()next; q-next=NULL; file2.close(); while(sum=0);/按用?户姓?名?查询用?户信?息void search_user() char ch40; int sum=0; user *head,*q,*p=new user; head=p; char name20; int ID; int password; ifstream file(D:user_information.txt); do coutch; filenameIDpassword; p-

16、set_information(name,ID,password); q=p; while(!file.eof() p=new user; filenameID; p-set_information(name,ID,password); q-next=p; q=p; q-next=NULL; file.close(); p=head; while(p!=NULL) if(strcmp(p-Getname(),ch)=0) sum+; p=p-next; if(sum=0) cout对?不?起e,?信?息库a没?有D与?您输?入?的?用?户姓?名?匹配?的?用?户信?息!?请?重?新?输?入?-

17、Getname(),ch)=0) coutsetw(20)姓?名?setw(10)IDendl; coutsetw(20)Getname()setw(10)GetID()next; while(sum=0);/删?除y用?户信?息void delete_user() char ch40; int sum=0; user *head,*q,*p=new user; head=p; char name20; int ID; int password; ifstream file(D:user_information.txt); do coutch; filenameIDpassword; p-se

18、t_information(name,ID,password); q=p; while(!file.eof() p=new user; filenameIDpassword; p-set_information(name,ID,password); q-next=p; q=p; q-next=NULL; file.close(); while(p!=NULL) if(strcmp(p-Getname(),ch)=0) sum+; q-next=p-next; delete p; p=p-next; if(sum=0) cout对?不?起e,?信?息库a中D没?有D与?您输?入?的?用?户姓?名

19、?匹配?的?用?户信?息!?请?重?新?输?入?-endl; else ofstream file2(D:house_information.txt); p=head; while(p!=NULL) file2tGetname()tGetID()tGetpassword()next; q-next=NULL; file2.close(); while(sum=0);/增?加一?条?新?的?用?户信?息void add_user() char name20; int ID; int password; coutnameIDpassword; ofstream file(D:user_inform

20、ation.txt,ios:app); filennametIDtpassword; file.close();/修T改?用?户信?息void modify_user() char ch40; int sum=0; do coutch; user *head,*q,*p=new user; head=p; char name40; int ID; int password; ifstream file1(D:user_information.txt); file1nameIDpassword; p-set_information(name,ID,password); q=p; while(!f

21、ile1.eof() p=new user; file1nameIDpassword; p-set_information(name,ID,password); q-next=p; q=p; q-next=NULL; file1.close(); p=head; while(p!=NULL) if(strcmp(p-Getname(),ch)=0) strcpy(name,p-Getname(); ID=p-GetID(); password=p-Getpassword(); char choice; int passcode; do cout请?输?入?您想?要a修T改?的?信?息:on; coutchoice; switch(choice) case a: case A:coutname;break; case b: case B: do coutpassword; coutpasscode; if(password=passcode) cout密码?设置?成功|!?endl; else cout输?入?的?密码?不?一?致?!?请?重?新?输?入?-endl; while(password!=passcode); break; default:cout对?不?起e,?您输?入?的?指?令?不?正y确

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1