小区物业管理系统(3)

2019-03-03 20:17

//zhuhu.txt保存了所有客户的信息 if(!infile) { }

for(i=0;i

infile.read((char *)p1,sizeof(Zhuhu));//运用二进制文件操作函数,方便快cerr<<\ abort();

捷,不用重载

if(i==0) head=p1; p2=new Zhuhu;

if(i==count-1) p1->next=NULL; else {p1->next=p2; p1=p2;} ;}

infile.close();//关闭文件,防止误操作

Zhuhu *jianli(Zhuhu *head);//建立数据库函数声明 void shuchu(Zhuhu *head); Zhuhu *charu(Zhuhu *head); Zhuhu *shanchu(Zhuhu *head); void zhixing(Zhuhu *head);

void chaxun(Zhuhu *head);//查询功能函数 void tongji(Zhuhu *head); void paixu(Zhuhu *head); string con=\

cout<<\※※※※※※欢迎进入小区物业管理系统※※※※※※※※\cout<<\ 开发人:秦国栋\(07电子信息1班)\if(count==0)

11

{cout<<\

_____\

cout<<\警告★★您的数据库是空的,请首先建立数据库!!!!★★\cout<<\

____\

while(con!=\while(con!=\循环命令机制,这种比较方便,简单 {

cout<<\建立数据库\cout<<\输出所有信息\cout<<\添加住户\cout<<\删除住户\cout<<\收费功能\cout<<\查询功能\cout<<\统计空房\cout<<\排序功能\

cout<<\退出系统,保存数据\cout<<\我的命令是********:-->\cin>>con;

&&con!=\

{ }

cout<<\错误命令,重新输入:\cin>>con;

if(con==\

head=jianli(head);

if(con==\

shuchu(head);

if(con==\

12

head=charu(head);

if(con==\

head=shanchu(head);

if(con==\

zhixing(head);

if(con==\

chaxun(head);

if(con==\

tongji(head);

if(con==\

paixu(head);

cout<<\提示[*操作完毕请选择退出程序(选择命令[0]),否则您的数据将

不能保存!*]\必须退出

};

//务必退出程序,否则处理结果无法保存

p1=head;

ofstream countfile(\ if(!countfile) { }

cerr<<\ abort();

countfile<

ofstream outfile(\ if(!outfile) { }

13

cerr<<\abort();

}

for(i=0;i

outfile.close(); return 0;

outfile.write((char *)p1,sizeof(Zhuhu)); p1=p1->next;

Zhuhu *jianli(Zhuhu *head) {Zhuhu *p1,*p2;

if(count>0)//此时不允许录入数据,只能使用添加功能录入

{cout<<\警告!!您的数据库已经存在,若要重新建立,请清除zhuhu文件内容并使count文件归0\

cout<<\_______\}

if(count==0) {

p1=p2=new Zhuhu; head=p1; int n;

cout<<\请输入需要建立的住户数:\cin>>n;

for(int i=0;i

cout<<\第\位住户信息\p1->input_message(); p1=new Zhuhu;

14

if(i==n-1) p2->next=NULL; else p2->next=p1;

p2=p1;

}

if(i==n) p2->next=NULL; count=n;

}

return head; }

void shuchu(Zhuhu *head) {Zhuhu *p1; p1=head; while(p1!=NULL) { p1->show_message(); p1=p1->next;

} ;}

Zhuhu *charu(Zhuhu *head) { cout<<\请输入要添加住户的详细信息:\ Zhuhu *p0,*p1,*p2,*p3; p3=p1=head; p0=new Zhuhu; p0->input_message(); while(p3->next!=NULL) { if(p3->get_num()==p0->get_num())

{cout<<\您输入输入输入的房号有误或非空房,请重新输入!\ p0->input_message(); }

p3=p3->next;

15


小区物业管理系统(3).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:酒店厨房管理(全套计划书)

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: