1、房屋租售管理系统c 程序设计程序设计报告( 2012 / 2013 学年 第 一 学期)题 目: 房屋租售管理系统 专 业 学 生 姓 名 班 级 学 号 指 导 教 师 指 导 单 位 日 期 2012.11.02 评 分 细 则评分项优秀良好中等差遵守机房规章制度上机时地表现学习态度程序准备情况程序设计能力团队合作精神课题功能实现情况算法设计合理性用户界面设计报告书写认真程度内容详实程度文字表达熟练程度回答问题准确度简 短 评 语教师签名: 年 月 日评分等级备注评分等级有五种:优秀、良好、中等、及格、不及格房屋租售管理系统一、 课题内容和要求 该系统要求建立某房屋租售中介管理系统,并实现
2、输入口令进入系统、基础信息建立、客户统计、房源排序、销售业绩及佣金收入统计、相关文件存盘功能.通过此课题,熟练掌握文件、数组、指针地各种操作,以及一些算法思想地应用.二、需求分析 模块一:基础信息管理,该模块实现员工、楼盘及门店信息地查看与建立; 模块二:客户管理,该模块实现客户信息地建立、查看与各类客户数量统计;模块三:房源查看,该模块实现房源信息按租金升序、售金升序、租金降序、售金降序显示;模块四:统计分析,该模块实现某一指定时间段内销售情况及佣金收入统计;模块五:保存文件,该模块实现各类相关文件地保存; 模块六:退出系统,该模块实现本系统地退出;三、概要设计 N Y 1 2 3 4 5
3、01.基础信息管理:包括楼盘信息查询、员工信息查询、门店信息查询、楼盘信息建立、员工信息建立、门店信息建立、返回上级菜单几项功能;2.客户管理:包括客户信息查询、客户信息建立、客户数量统计及返回上级菜单几项功能;3.房源查看:包括按租金升序显示房源信息、按租金降序显示房源信息、按售金升序显示房源信息、按售金降序显示房源信息及返回上级菜单几项功能;4.统计分析:包括销售情况及佣金收入统计及返回上级菜单几项功能;5.保存文件:保存所有相关文件;6退出系统:退出房屋租售管理系统.四、源程序代码 #include#include#include#include#include#includeusing
4、 namespace std。class Date /定义日期类protected: int year。 /年 int month。 /月 int day。 /日public: void Set(int,int,int)。 /设置日期 void Input()。 /输入日期 bool operator(Date ob)const。 /重载运算,实现日期比较 int GetYear()。 /返回年 int GetMonth()。 /返回月 int GetDay()。 /返回日 。/Date类函数地实现void Date:Set(int y,int m,int d) year=y。 month=m
5、。 day=d。void Date:Input() coutyear。 coutmonth。 coutday。bool Date:operator(Date ob)const if(yearob.year) return true。 else if(year=ob.year) if(monthob.month) return true。 else if(month=ob.month) if(dayob.day) return true。 else return false。 else return false。 else return false。int Date:GetYear() retu
6、rn year。int Date:GetMonth() return month。int Date:GetDay() return day。class Floor /定义楼盘类protected: string Num。 /楼盘编号 double Size。 /楼盘面积 double Hire。 /楼盘租金 double Buy。 /楼盘售金 bool State。 /楼盘状态(1-售,0-租) Date Da。 /租出/售出日期public: Floor(string nu,double si,double hi,double bu,bool st,int y,int m,int d)。 /
7、构造函数 void Input()。 /输入单个楼盘信息 bool operator(Floor ob)const。 /重载运算,set容器要求元素之间满足该关系 string GetNum()。 /返回楼盘编号 double GetSize()。 /返回楼盘面积 double GetHire()。 /返回楼盘租金 double GetBuy()。 /返回楼盘售金 bool GetState()。 /返回楼盘状态 Date GetDa()。 /返回楼盘租出/售出日期。/Floor类函数地实现Floor:Floor(string nu,double si,double hi,double bu,
8、bool st,int y,int m,int d) Num=nu。 Size=si。 Hire=hi。 Buy=bu。 State=st。 Da.Set(y,m,d)。void Floor:Input() coutNum。 coutendl。 coutSize。 coutendl。 coutHire。 coutendl。 coutBuy。 coutendl。 coutState。 coutendl。 cout租出/售出日期: n。 Da.Input()。bool Floor:operator(Floor ob)const if(Numob.Num) return true。 else ret
9、urn false。string Floor:GetNum() return Num。double Floor:GetSize() return Size。double Floor:GetHire() return Hire。double Floor:GetBuy() return Buy。bool Floor:GetState() return State。Date Floor:GetDa() return Da。class Staff /定义员工类protected: string Number。 /员工编号 string Name。 /员工姓名 char Sex。 /员工性别 strin
10、g Tel。 /员工电话 double Commission。 /员工工资public: Staff(string num,string na,char se,string te,double co)。 /构造函数 void Input()。 /输入员工信息 bool operator(Staff ob)const。 /重载运算,set容器要求元素之间满足该关系 string GetNumber()。 /返回员工编号 string GetName()。 /返回员工姓名 char GetSex()。 /返回员工性别 string GetTel()。 /返回员工电话 double GetCommi
11、ssion()。 /返回员工工资。/Staff类函数地实现Staff:Staff(string num,string na,char se,string te,double co) Number=num。 Name=na。 Sex=se。 Tel=te。 Commission=co。void Staff:Input() coutName。 coutNumber。 coutSex。 coutTel。 coutCommission。bool Staff:operator(Staff ob)const if(Numberob.Number) return true。 else return fals
12、e。string Staff:GetNumber() return Number。string Staff:GetName() return Name。char Staff:GetSex() return Sex。string Staff:GetTel() return Tel。double Staff:GetCommission() return Commission。class Store /定义门店类protected: string StoNum。 /门店编号 int StaffNum。 /员工数量 int FloorNum。 /负责楼盘数量public: Store(string s
13、n,int st,int fl)。 /构造函数 void Input()。 /输入门店信息 bool Store:operator(Store ob)const。 /重载运算,set容器要求元素之间满足该关系 string GetStoNum()。 /返回门店编号 int GetStaffNum()。 /返回员工数量 int GetFloorNum()。 /返回负责楼盘数量。/Store类函数地实现Store:Store(string sn,int st,int fl) StoNum=sn。 StaffNum=st。 FloorNum=fl。void Store:Input() coutSto
14、Num。 coutendl。 coutStaffNum。 coutendl。 coutFloorNum。 coutendl。bool Store:operator(Store ob)const if(StoNumob.StoNum) return true。 else return false。string Store:GetStoNum() return StoNum。int Store:GetStaffNum() return StaffNum。int Store:GetFloorNum() return FloorNum。class Client /定义客户类protected: str
15、ing name。 /客户姓名 string number。 /客户编号 char sex。 /客户性别 string tel。 /客户电话 int type。 /客户类别public: Client(string na,string nu,char se,string te,int ty)。 /构造函数 void Input()。 /输入客户信息 bool Client:operator(Client ob)const。 /重载运算,set容器要求元素之间满足该关系 string GetName()。 /返回客户姓名 string GetNumber()。 /返回客户编号 char GetS
16、ex()。 /返回客户性别 string GetTel()。 /返回客户电话 int GetType()。 /返回客户类型。/Client类函数实现Client:Client(string na,string nu,char se,string te,int ty) name=na。 number=nu。 sex=se。 tel=te。 type=ty。void Client:Input() coutname。 coutnumber。 coutsex。 couttel。 couttype。bool Client:operator(Client ob)const if(numberob.numb
17、er) return true。 else return false。string Client:GetName() return name。string Client:GetNumber() return number。char Client:GetSex() return sex。string Client:GetTel() return tel。int Client:GetType() return type。class Adminprotected: set fl。 /Floor类数据集 set sta。 /Staff类数据集 set sto。 /Store类数据集 set cl。 /
18、Client类数据集 public: Admin()。 /构造函数 void ReadFloor()。 /读取楼盘文件 void ReadStaff()。 /读取员工文件 void ReadStore()。 /读取门店文件 void ReadClient()。 /读取客户文件 void ShowFloorInfo()。 /显示所有楼盘信息 void ShowStaffInfo()。 /显示所有员工信息 void AddFloor()。 /添加楼盘信息 void AddStaff()。 /添加员工信息 void ShowStoreInfo()。 /显示所有门店信息 void AddStore()
19、。 /添加门店信息 void ShowClientInfo()。 /显示所有客户信息 void AddClient()。 /添加客户信息 void HireRise()。 /按租金升序显示所有楼盘信息 void HireFall()。 /按租金降序显示所有楼盘信息 void BuyRise()。 /按售金升序显示所有楼盘信息 void BuyFall()。 /按售金降序显示所有楼盘信息 void SellSta()。 /某段时间内销售及佣金收入统计 void ClientSta()。 /客户信息统计 void SaveFloor()。 /楼盘信息存档 void SaveStaff()。 /员工
20、信息存档 void SaveStore()。 /门店信息存档 void SaveClient()。 /客户信息存档。Admin:Admin() /定义对象地同时读取文件 ReadFloor()。 ReadStaff()。 ReadStore()。 ReadClient()。void Admin:ReadFloor() ifstream in(C:FloorInfo.txt)。 if(!in) coutCannot open the file:FloorInfo.txtn。 return 。 string Num。 double Size。 double Hire。 double Buy。 bo
21、ol State。 int y。 int m。 int d。 set:iterator p=fl.begin()。 inNumSizeHireBuyStateymd。 while(!in.eof() Floor ob(Num,Size,Hire,Buy,State,y,m,d)。 fl.insert(ob)。 inNumSizeHireBuyStateymd。 in.close()。 return。void Admin:ReadStaff() ifstream in(C:StaffInfo.txt)。 if(!in) coutCannot open the file:StaffInfo.txt
22、n。 return 。 string Number。 string Name。 char Sex。 string Tel。 double Commission。 set:iterator p=sta.begin()。 inNumberNameSexTelCommission。 while(!in.eof() Staff ob(Number,Name,Sex,Tel,Commission)。 sta.insert(ob)。 inNumberNameSexTelCommission。 in.close()。 return。void Admin:ReadStore() ifstream in(C:S
23、toreInfo.txt)。 if(!in) coutCannot open the file:StoreInfo.txtn。 return 。 string StoNum。 int StaffNum。 int FloorNum。 set:iterator p=sto.begin()。 inStoNumStaffNumFloorNum。 while(!in.eof() Store ob(StoNum,StaffNum,FloorNum)。 sto.insert(ob)。 inStoNumStaffNumFloorNum。 in.close()。 return。void Admin:ReadCl
24、ient() ifstream in(C:ClientInfo.txt)。 if(!in) coutCannot open the file:ClientInfo.txtn。 return 。 string name。 string number。 char sex。 string tel。 int type。 set:iterator p=cl.begin()。 innumbernamesexteltype。 while(!in.eof() Client ob(name,number,sex,tel,type)。 cl.insert(ob)。 innumbernamesexteltype。
25、in.close()。 return。void Admin:ShowFloorInfo() system(cls)。 cout楼盘编号 楼盘面积 楼盘租金 楼盘售金 楼盘状态 租出/售出日期n。 set:iterator p=fl.begin()。 while(p!=fl.end() cout GetNum()t GetSize()t GetHire()t GetBuy()GetState() cout售t 。 else coutGetDa()。 coutbi.GetYear()-bi.GetMonth()-bi.GetDay()endl。 p+。 void Admin:ShowStaffInfo
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1