房屋中介管理系统C++_第1页
房屋中介管理系统C++_第2页
房屋中介管理系统C++_第3页
房屋中介管理系统C++_第4页
房屋中介管理系统C++_第5页
已阅读5页,还剩17页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

综 合 程 序 设 计(房屋中介管理系统)编辑小组成员:龚向文、周大量、郑传周 (输配电1班)2012-09-13各人负责项目:龚向文:顾客信息(Customer),房屋信息(House)郑传周:登录方式(Logo)周大量:统计资料(sta)王星峰:主函数(main)1*第一部分:-请选择操作: 1、 用户登录2、 用户注册选择2,用户注册。输入你的姓名: 输入密码 若密码不足8位或超出16位则:密码无效,请重新输入。注册完毕,选择1登录。输入用户名、密码。第二部分:登录成功,进入主菜单。 请选择操作类型:1、 表示房屋/客户信息查询2、 表示房屋/顾客信息进行增删改3、 表示进行相关信息统计第三部分:主菜单:选择1,进入信息查询系统输入查询的方面:1、 表示房屋2、 表示顾客选择1:输入你要查询的物业名称: 选择2:输入你要查询的客户名称: 主菜单:选择2选择操作:1、 表示对房屋操作2、 表示对顾客操作选择1输入操作类型:1、 表示信息增加2、 表示修改信息3、 表示删除信息选择1输入物业名称: 输入房屋地段: 输入房屋户型: 输入房屋朝向: 输入房屋设施: 输入房屋面积: 输入房屋价格: 完毕!在此的基础上,输入操作类型,选择2表示修改信息。选择2:输入你需要更新的物业名字: 在此的基础上,输入操作类型,选择3表示删除信息。选择3:输入你需要删除的物业名字: 完毕!在选择操作,选择2表示对顾客操作。选择2:输入操作类型:1、 表示信息增加2、 表示修改信息3、 表示删除信息 在输入操作类型中:选择1表示信息增加。选择1输入客户名称: 输入客户联系方式: 在输入操作类型中:选择2表示修改信息。选择2输入你需要更新的客户名字即: 在输入操作类型中:选择3表示删除信息。选择3 输入你要删除的客户名称: 完毕!主菜单: 选择操作:1、 表示对房屋总数的统计2、 表示对顾客总数的统计选择1,表示对房屋总数的统计。选择2,表示对顾客总数的统计完毕!程序代码,及其文字说明:/(1)登录管理模块:主要实现登录身份的管理、密码管理#include #include #include #include using namespace std;class Logoprivate:string name;string password;public:int in();/接受用户登录请求,决定是否允许登入void reg(); /用户注册void print();/用户登录界面提示;int Logo:in()string n,p;int i=0,j=0;/j值表示是否存在此用户cout输入姓名n;cout输入密码p;ifstream input;input.open (logoinfo.txt);while(!input.eof ()inputnamepassword;if(name=n&p=password)i=1;if(n=name)j=1;input.close ();if(j=0)cout用户不存在,请先注册!endl;return i;/i值为1表示登录成功;为0时表示登录失败void Logo:reg ()/ ofstream output;output.open (logoinfo.txt,ios:out|ios:app);cout输入你的姓名:name;cout输入密码(有效位数8-16)password;while(password.size ()16)cout密码无效,请重新输入password;outputname passwordendl;output.close ();cout注册成功endl;void Logo:print ()coutsetw(40)欢迎使用房屋中介管理系统endl;cout请选择操作:endl;coutttt1、用户登录endl;coutttt2、用户注册endl;/(2)房屋信息管理模块:房屋信息的增、删、改、查。/类House,name(物业名称),place(地段),type(户型),direction(朝向),area(面积),equip(房屋设施),price(价格),/使用文件“houseinfo.txt”,hsize.txtclass Houseprivate:string name,place,type,direction,equip;float area,price;public: string getname1()returnHouse:name;unsigned long hsize;void add();/增加一条房屋信息void del();/删除一条房屋信息void alter();/修改一条房屋记录void select(); /查找房屋信息void set(string n,string p,string t,string d,string e,float a,float pr)name=n;place=p;type=t; direction=d; equip=e;area=a;price=pr;void print()fstream inout;inout.open(houseinfo.txt,ios:out|ios:app);inoutname place type direction equip area pricehsize;isize.close();/对文件hsize.txt操作,读出房屋的信息条数;fstream inout;inout.open (houseinfo.txt,ios:out|ios:app);cout输入物业名称:name;cout输入房屋地段:place;cout输入房屋户型:type;cout输入房屋朝向:direction;cout输入房屋设施:equip;cout输入房屋面积:area;cout输入房屋价格:price;inoutname place type direction equip area priceendl;inout.close ();hsize+;fstream osize;osize.open (hsize.txt,ios:out);osizehsize;osize.close ();/对文件hsize.txt操作,写入新的房屋的信息条数cout房屋信息更新完成。hsize;isize.close();/对文件hsize.txt操作,读出房屋的信息条数;cout输入你需要删除的物业名字:isname;House *a=new Househsize;int i=0,flag=0;ifstream input;input.open (houseinfo.txt,ios:in);while(!input.eof ()inputnameplacetypedirectionequipareaprice;if(name=isname)flag+;/flag记录要删除房屋的个数continue;elseai.set (name,place,type,direction,equip,area,price);i+;input.close();ofstream output;output.open(houseinfo.txt,ios:out);for(i=0;ihsize-flag;i+)ai.print();output.close();fstream osize;osize.open (hsize.txt,ios:out);osizehsize-flag;osize.close ();void House:alter()cout输入你需要更新的物业名字即endl;House:del();cout输入更新后房屋信息endl;House:add ();void House:select()string hname;fstream inout;cout输入你要查询的物业名称hname;inout.open (houseinfo.txt,ios:in);while(!inout.eof ()inoutnameplacetypedirectionequipareaprice;if(name=hname)cout物业名称nameendl; cout房屋地段placeendl; cout房屋户型typeendl; cout房屋朝向directionendl; cout房屋设施equipendl; cout房屋面积areaendl; cout房屋价格priceendl;else continue;inout.close ();/(3)顾客管理模块,顾客信息的增、删、改、查。/类Customer cname(顾客姓名),tel(联系方式),/使用文件“coustomerinfo.txt”,csize.txtclass Customerprivate:string cname,tel;public: string getname2()returnCustomer:cname;unsigned long csize;void add();/增加一条客户信息void del();/删除一条客户信息void alter();/修改一条客户记录void select(); /查找客户信息 void set(string cn,string te)cname=cn;tel=te;void print()fstream inout;inout.open(customerinfo.txt,ios:out|ios:app);inoutcname telcsize;isize.close();/对文件csize.txt操作,读出客户的信息条数;fstream inout;inout.open (customerinfo.txt,ios:out|ios:app);cout输入客户名称:cname;cout输入客户联系方式:tel; inoutcname telendl;inout.close ();csize+;fstream osize;osize.open (csize.txt,ios:out);osizecsize;osize.close ();/对文件csize.txt操作,写入新的客户的信息条数cout客户信息更新完成。csize;isize.close();/对文件csize.txt操作,读出客户的信息条数;cout输入你需要删除的客户名字:isname; Customer *b=new Customercsize;int i=0,flag=0;ifstream input;input.open (customerinfo.txt,ios:in);while(!input.eof ()inputcnametel;if(cname=isname)flag+;/flag记录要删除客户的个数continue;elsebi.set (cname,tel);i+;input.close();ofstream output;output.open(customerinfo.txt,ios:out);for(i=0;icsize-flag;i+)bi.print();output.close();fstream osize;osize.open (csize.txt,ios:out);osizecsize-flag;osize.close ();void Customer:alter()cout输入你需要更新的客户名字即endl;Customer:del();cout输入更新后客户信息endl;Customer:add ();void Customer:select()string find;fstream inout;cout输入你要查询的客户名称find;inout.open (customerinfo.txt,ios:in);while(!inout.eof ()inoutcnametel;if(cname=find)cout客户姓名cnameendl; cout客户联系方式telsize; input.close (); cout房屋总数为:sizesize; input.close (); cout顾客的总数为:sizeflag1;if(flag1=1)flag2=customer.in ();/用户登录while(flag2=0)coutttt您登录失败。endl;coutttt3退出系统endl;coutttt其他数字重新登录endl;coutttt请选择:i;if(i=3)return 0;flag2=customer.in ();else if(flag1=2)customer.reg ();/新用户注册cout你将退出系统,如需其他操作请重新登录系统endl;return 0;else cout输入有误endl;return 0;system(cls);cout恭喜您登录成功!endl;coutsetw(40)(主菜单)请选择操作类型:endl;coutttt1表示房屋/客户信息查询;endl;coutttt2表示房屋/顾客信息进行增删改;endl;coutttt3表示进行相关信息统计flag3;switch(flag3)case 1:system(cls);cout欢迎进入信息查询系统endl;coutsetw(40)输入查询的方面:endl;coutttt1表示房屋endl;coutttt2表示顾客flag4;if(flag4=1)House H;H.select ();else if(flag4=2)Customer C;C.select ();els

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论