c课程设计小区物业管理系统内容摘要:

捷,不用重载 if(i==0) head=p1。 p2=new Zhuhu。 if(i==count1) p1next=NULL。 else {p1next=p2。 p1=p2。 }。 } ()。 //关闭文件,防止误操作 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=1。 cout※※※※※※欢迎进入小区物业管理系统※※※※※※※※ endl。 if(count==0) 12 {cout_______________________________________________________________endl。 cout警告★★您的数据库是空的,请首先建立数据库 !!!!★★ endl。 cout_______________________________________________________________endl。 } while(con!=0)//循环命令机制,这种比较方便,简单 { cout[1]建立数据库 endl。 cout[2]输出所有信息 endl。 cout[3]添加住户 endl。 cout[4]删除住户 endl。 cout[5]收费功能 endl。 cout[6]查询功能 endl。 cout[7]统计空房 endl。 cout[8]排序功能 endl。 cout[0]退出系统,保存数据 endl。 cout***********我的命令是 ********:。 cincon。 while(con!=1amp。 amp。 con!=2amp。 amp。 con!=3amp。 amp。 con!=4amp。 amp。 con!=5amp。 amp。 con!=6amp。 amp。 con!=7amp。 amp。 con!=8amp。 amp。 con!=0) { cout错误命令,重新输入 :。 cincon。 } if(con==1) head=jianli(head)。 if(con==2) shuchu(head)。 if(con==3) 13 head=charu(head)。 if(con==4) head=shanchu(head)。 if(con==5) zhixing(head)。 if(con==6) chaxun(head)。 if(con==7) tongji(head)。 if(con==8) paixu(head)。 cout提示 [*操作完毕请选择退出程序 (选择命令 [0]),否则您的数据将不能保存 !*]endl。 //必须退出 //务必退出程序,否则处理结果无法保存 }。 p1=head。 ofstream countfile(,ios::binary)。 if(!countfile) { cerropen error!endl。 abort()。 } countfilecount。 //存储人数到文件中 ()。 ofstream outfile(,ios::binary)。 if(!outfile) { cerropen error!endl。 abort()。 } 14 for(i=0。 icount。 i++)//存储处理后的所有记录 { ((char *)p1,sizeof(Zhuhu))。 p1=p1next。 } ()。 return 0。 } Zhuhu *jianli(Zhuhu *head) {Zhuhu *p1,*p2。 if(count0)//此时不允许录入数据,只能使用添加功能录入 {cout警告 !!您的数据库已经存在 ,若要重新建立,请清除 zhuhu 文件内容并使count 文件归 0endl。 cout_____________________________________________________________________endl。 } if(count==0) { p1=p2=new Zhuhu。 head=p1。 int n。 cout请输入需要建立的住户数: endl。 cinn。 for(int i=0。 in。 i++) { cout第 i+1位住户信 息 endl。 p1input_message()。 p1=new Zhuhu。 if(i==n1) p2next=NULL。 else p2next=p1。 15 p2=p1。 } if(i==n) p2next=NULL。 count=n。 } return head。 } void shuchu(Zhuhu *head) {Zhuhu *p1。 p1=head。 while(p1!=NULL) { p1show_message()。 p1=p1next。 }。 } Zhuhu *charu(Zhuhu *head) { cout请输入要添加住户的详细信息: endl。 Zhuhu *p0,*p1,*p2,*p3。 p3=p1=head。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。