




版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、程序設(shè)計(jì)報(bào)告( 2012 / 2013 學(xué)年 第 一 學(xué)期)題 目: 房屋租售管理系統(tǒng) 專(zhuān) 業(yè) 學(xué) 生 姓 名 班 級(jí) 學(xué) 號(hào) 指 導(dǎo) 教 師 指 導(dǎo) 單 位 日 期 2012.11.02 評(píng) 分 細(xì) 則評(píng)分項(xiàng)優(yōu)秀良好中等差遵守機(jī)房規(guī)章制度上機(jī)時(shí)的表現(xiàn)學(xué)習(xí)態(tài)度程序準(zhǔn)備情況程序設(shè)計(jì)能力團(tuán)隊(duì)合作精神課題功能實(shí)現(xiàn)情況算法設(shè)計(jì)合理性用戶(hù)界面設(shè)計(jì)報(bào)告書(shū)寫(xiě)認(rèn)真程度內(nèi)容詳實(shí)程度文字表達(dá)熟練程度回答問(wèn)題準(zhǔn)確度簡(jiǎn) 短 評(píng) 語(yǔ)教師簽名: 年 月 日評(píng)分等級(jí)備注評(píng)分等級(jí)有五種:優(yōu)秀、良好、中等、及格、不及格房屋租售管理系統(tǒng)一、 課題內(nèi)容和要求 該系統(tǒng)要求建立某房屋租售中介管理系統(tǒng),并實(shí)現(xiàn)輸入口令進(jìn)入系統(tǒng)、基礎(chǔ)信息建
2、立、客戶(hù)統(tǒng)計(jì)、房源排序、銷(xiāo)售業(yè)績(jī)及傭金收入統(tǒng)計(jì)、相關(guān)文件存盤(pán)功能。通過(guò)此課題,熟練掌握文件、數(shù)組、指針的各種操作,以及一些算法思想的應(yīng)用。二、需求分析模塊一:基礎(chǔ)信息管理,該模塊實(shí)現(xiàn)員工、樓盤(pán)及門(mén)店信息的查看與建立;模塊二:客戶(hù)管理,該模塊實(shí)現(xiàn)客戶(hù)信息的建立、查看與各類(lèi)客戶(hù)數(shù)量統(tǒng)計(jì);模塊三:房源查看,該模塊實(shí)現(xiàn)房源信息按租金升序、售金升序、租金降序、售金降序顯示;模塊四:統(tǒng)計(jì)分析,該模塊實(shí)現(xiàn)某一指定時(shí)間段內(nèi)銷(xiāo)售情況及傭金收入統(tǒng)計(jì);模塊五:保存文件,該模塊實(shí)現(xiàn)各類(lèi)相關(guān)文件的保存;模塊六:退出系統(tǒng),該模塊實(shí)現(xiàn)本系統(tǒng)的退出;三、概要設(shè)計(jì) 開(kāi)始輸入密碼密碼正確確ny進(jìn)入系統(tǒng)統(tǒng)計(jì)分析保存文件退出系統(tǒng)房源
3、查看客戶(hù)管理基礎(chǔ)信息管理123450結(jié)束1.基礎(chǔ)信息管理:包括樓盤(pán)信息查詢(xún)、員工信息查詢(xún)、門(mén)店信息查詢(xún)、樓盤(pán)信息建立、員工信息建立、門(mén)店信息建立、返回上級(jí)菜單幾項(xiàng)功能;2.客戶(hù)管理:包括客戶(hù)信息查詢(xún)、客戶(hù)信息建立、客戶(hù)數(shù)量統(tǒng)計(jì)及返回上級(jí)菜單幾項(xiàng)功能;3.房源查看:包括按租金升序顯示房源信息、按租金降序顯示房源信息、按售金升序顯示房源信息、按售金降序顯示房源信息及返回上級(jí)菜單幾項(xiàng)功能;4.統(tǒng)計(jì)分析:包括銷(xiāo)售情況及傭金收入統(tǒng)計(jì)及返回上級(jí)菜單幾項(xiàng)功能;5.保存文件:保存所有相關(guān)文件;6退出系統(tǒng):退出房屋租售管理系統(tǒng)。四、源程序代碼 #include#include#include#include#i
4、nclude#includeusing namespace std;class date /定義日期類(lèi)protected:int year; /年int month; /月int day; /日public:void set(int,int,int); /設(shè)置日期void input(); /輸入日期bool operator(date ob)const; /重載運(yùn)算,實(shí)現(xiàn)日期比較int getyear(); /返回年int getmonth(); /返回月int getday(); /返回日 ;/date類(lèi)函數(shù)的實(shí)現(xiàn)void date:set(int y,int m,int d)year=y
5、;month=m;day=d;void date:input()coutyear;coutmonth;coutday;bool date:operator(date ob)constif(yearob.year)return true;else if(year=ob.year)if(monthob.month)return true;else if(month=ob.month)if(dayob.day)return true;elsereturn false;else return false;elsereturn false;int date:getyear()return year;in
6、t date:getmonth()return month;int date:getday()return day;class floor /定義樓盤(pán)類(lèi)protected:string num; /樓盤(pán)編號(hào) double size; /樓盤(pán)面積 double hire; /樓盤(pán)租金 double buy; /樓盤(pán)售金 bool state; /樓盤(pán)狀態(tài)(1-售,0-租)date da; /租出/售出日期public:floor(string nu,double si,double hi,double bu,bool st,int y,int m,int d); /構(gòu)造函數(shù)void input(
7、); /輸入單個(gè)樓盤(pán)信息 bool operator(floor ob)const; /重載運(yùn)算,set容器要求元素之間滿(mǎn)足該關(guān)系string getnum(); /返回樓盤(pán)編號(hào)double getsize(); /返回樓盤(pán)面積 double gethire(); /返回樓盤(pán)租金double getbuy(); /返回樓盤(pán)售金bool getstate(); /返回樓盤(pán)狀態(tài)date getda(); /返回樓盤(pán)租出/售出日期;/floor類(lèi)函數(shù)的實(shí)現(xiàn)floor:floor(string nu,double si,double hi,double bu,bool st,int y,int m,i
8、nt 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)constif(numob.num)return true;elsereturn false;string floor:getnum()return num;d
9、ouble 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 /定義員工類(lèi)protected:string number;/員工編號(hào) string name; /員工姓名char sex; /員工性別string tel; /員工電話(huà) double commission; /員工工資public:staff(str
10、ing num,string na,char se,string te,double co); /構(gòu)造函數(shù) void input(); /輸入員工信息bool operator(staff ob)const; /重載運(yùn)算,set容器要求元素之間滿(mǎn)足該關(guān)系string getnumber(); /返回員工編號(hào)string getname(); /返回員工姓名char getsex(); /返回員工性別string gettel(); /返回員工電話(huà)double getcommission(); /返回員工工資;/staff類(lèi)函數(shù)的實(shí)現(xiàn)staff:staff(string num,string n
11、a,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)constif(numberob.number)return true;elsereturn false;string staff:getnumber()return number;string staff:getname()return name;
12、char staff:getsex()return sex;string staff:gettel()return tel;double staff:getcommission()return commission;class store /定義門(mén)店類(lèi)protected:string stonum; /門(mén)店編號(hào)int staffnum; /員工數(shù)量int floornum; /負(fù)責(zé)樓盤(pán)數(shù)量public:store(string sn,int st,int fl); /構(gòu)造函數(shù)void input(); /輸入門(mén)店信息bool store:operator(store ob)const; /重載
13、運(yùn)算,set容器要求元素之間滿(mǎn)足該關(guān)系string getstonum(); /返回門(mén)店編號(hào)int getstaffnum(); /返回員工數(shù)量int getfloornum(); /返回負(fù)責(zé)樓盤(pán)數(shù)量;/store類(lèi)函數(shù)的實(shí)現(xiàn)store:store(string sn,int st,int fl)stonum=sn;staffnum=st;floornum=fl;void store:input()coutstonum;coutendl;coutstaffnum;coutendl;coutfloornum;coutendl;bool store:operator(store ob)consti
14、f(stonumob.stonum)return true;elsereturn false;string store:getstonum()return stonum;int store:getstaffnum()return staffnum;int store:getfloornum()return floornum;class client /定義客戶(hù)類(lèi)protected:string name; /客戶(hù)姓名string number; /客戶(hù)編號(hào)char sex; /客戶(hù)性別string tel; /客戶(hù)電話(huà)int type; /客戶(hù)類(lèi)別public:client(string na
15、,string nu,char se,string te,int ty); /構(gòu)造函數(shù)void input(); /輸入客戶(hù)信息bool client:operator(client ob)const; /重載運(yùn)算,set容器要求元素之間滿(mǎn)足該關(guān)系string getname(); /返回客戶(hù)姓名string getnumber(); /返回客戶(hù)編號(hào)char getsex(); /返回客戶(hù)性別string gettel(); /返回客戶(hù)電話(huà)int gettype(); /返回客戶(hù)類(lèi)型;/client類(lèi)函數(shù)實(shí)現(xiàn)client:client(string na,string nu,char se,s
16、tring 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)constif(numberob.number)return true;elsereturn false;string client:getname()return name;string client:getnumber()return number;char client:getsex()re
17、turn sex;string client:gettel()return tel;int client:gettype()return type;class adminprotected:set fl; /floor類(lèi)數(shù)據(jù)集set sta; /staff類(lèi)數(shù)據(jù)集set sto; /store類(lèi)數(shù)據(jù)集set cl; /client類(lèi)數(shù)據(jù)集 public:admin(); /構(gòu)造函數(shù)void readfloor(); /讀取樓盤(pán)文件void readstaff(); /讀取員工文件void readstore(); /讀取門(mén)店文件void readclient(); /讀取客戶(hù)文件void sh
18、owfloorinfo(); /顯示所有樓盤(pán)信息void showstaffinfo(); /顯示所有員工信息void addfloor(); /添加樓盤(pán)信息void addstaff(); /添加員工信息void showstoreinfo(); /顯示所有門(mén)店信息void addstore(); /添加門(mén)店信息void showclientinfo(); /顯示所有客戶(hù)信息void addclient(); /添加客戶(hù)信息void hirerise(); /按租金升序顯示所有樓盤(pán)信息void hirefall(); /按租金降序顯示所有樓盤(pán)信息void buyrise(); /按售金升序顯
19、示所有樓盤(pán)信息void buyfall(); /按售金降序顯示所有樓盤(pán)信息void sellsta(); /某段時(shí)間內(nèi)銷(xiāo)售及傭金收入統(tǒng)計(jì)void clientsta(); /客戶(hù)信息統(tǒng)計(jì)void savefloor(); /樓盤(pán)信息存檔void savestaff(); /員工信息存檔void savestore(); /門(mén)店信息存檔void saveclient(); /客戶(hù)信息存檔;admin:admin() /定義對(duì)象的同時(shí)讀取文件readfloor();readstaff();readstore();readclient();void admin:readfloor()ifstream
20、 in(c:floorinfo.txt);if(!in)coutcannot open the file:floorinfo.txtn;return ;string num;double size;double hire;double buy;bool 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.c
21、lose();return;void admin:readstaff()ifstream in(c:staffinfo.txt);if(!in)coutcannot open the file:staffinfo.txtn;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.
22、insert(ob);innumbernamesextelcommission;in.close();return;void admin:readstore()ifstream in(c:storeinfo.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,fl
23、oornum);sto.insert(ob);instonumstaffnumfloornum;in.close();return;void admin:readclient()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()cl
24、ient ob(name,number,sex,tel,type);cl.insert(ob);innumbernamesexteltype;in.close();return;void admin:showfloorinfo()system(cls);cout樓盤(pán)編號(hào) 樓盤(pán)面積 樓盤(pán)租金 樓盤(pán)售金 樓盤(pán)狀態(tài) 租出/售出日期n;set:iterator p=fl.begin();while(p!=fl.end()cout getnum()t getsize()t gethire()t getbuy()getstate()cout售t ;elsecoutgetda();coutbi.getyea
25、r()-bi.getmonth()-bi.getday()endl;p+;void admin:showstaffinfo()system(cls);cout員工編號(hào)t員工姓名t員工性別t員工電話(huà)t員工工資n;set:iterator p=sta.begin();while(p!=sta.end()cout getnumber()ttgetname()getsex()=f)cout男tt;elsecout女tt;coutgettel()t getcommission()n;p+;void admin:showstoreinfo()system(cls);cout門(mén)店編號(hào) 員工數(shù)量 負(fù)責(zé)樓盤(pán)數(shù)量
26、n;set:iterator p=sto.begin();while(p!=sto.end()cout getstonum()t getstaffnum()t getfloornum()endl;p+;void admin:showclientinfo()system(cls);cout客戶(hù)編號(hào) 客戶(hù)姓名 客戶(hù)性別 客戶(hù)電話(huà) 客戶(hù)類(lèi)別n;set:iterator p=cl.begin();while(p!=cl.end()cout getnumber()t getname()getsex()=f)cout男 ;elsecout女 ;coutgettel()gettype()=1)coutget
27、type()=2)coutgettype()=3)cout出租客戶(hù)n;elsecout出售客戶(hù)n;p+;void admin:addfloor()char ch=n;dofloor ob(1,1,1,1,1,1,1,1);ob.input();fl.insert(ob);cout繼續(xù)輸入?(y/n)ch;while(ch=y);void admin:addstaff()char ch=n;dostaff ob(1,1,1,1,1);ob.input();sta.insert(ob);cout繼續(xù)輸入?(y/n)ch;while(ch=y);void admin:addstore()char c
28、h=n;dostore ob(1,1,1);ob.input();sto.insert(ob);cout繼續(xù)輸入?(y/n)ch;while(ch=y);void admin:addclient()char ch=n;doclient ob(1,1,1,1,1);ob.input();cl.insert(ob);cout繼續(xù)輸入?(y/n)ch;while(ch = y);void admin:hirerise()int count=0;int i;double r=0;system(cls);cout樓盤(pán)編號(hào) 樓盤(pán)面積 樓盤(pán)租金 樓盤(pán)售金 樓盤(pán)狀態(tài) 租出/售出日期n;set:iterator
29、 p=fl.begin();while(p!=fl.end() /count用于樓盤(pán)計(jì)數(shù)count=count+1;p+;for(i=0;igethire()min&rgethire() /提取大于上一輪min值的最小租金min=p-gethire();p+;r=min; /r用于記錄min值p=fl.begin();while(p!=fl.end()if(min=p-gethire() /輸出本輪最小租金的樓盤(pán)信息cout getnum()t getsize()t gethire()t getbuy()getstate()cout售t ;elsecoutgetda();coutbi.gety
30、ear()-bi.getmonth()-bi.getday()endl;p+;void admin:hirefall()int count=0;int i;system(cls);cout樓盤(pán)編號(hào) 樓盤(pán)面積 樓盤(pán)租金 樓盤(pán)售金 樓盤(pán)狀態(tài) 租出/售出日期n;set:iterator p=fl.begin();while(p!=fl.end()count=count+1;p+;double r=100000000;for(i=0;icount;i+)double max=0;p=fl.begin();while(p!=fl.end()if(maxgethire()&rp-gethire()max=
31、p-gethire();p+;r=max;p=fl.begin();while(p!=fl.end()if(max=p-gethire()cout getnum()t getsize()t gethire()t getbuy()getstate()cout售t ;elsecoutgetda();coutbi.getyear()-bi.getmonth()-bi.getday()endl;p+;void admin:buyrise()int count=0;int i;system(cls);cout樓盤(pán)編號(hào) 樓盤(pán)面積 樓盤(pán)租金 樓盤(pán)售金 樓盤(pán)狀態(tài) 租出/售出日期n;set:iterator p
32、=fl.begin();while(p!=fl.end()count=count+1;p+;double r=0;for(i=0;ip-getbuy()&rgetbuy()min=p-getbuy();p+;r=min;p=fl.begin();while(p!=fl.end()if(min=p-getbuy()cout getnum()t getsize()t gethire()t getbuy()getstate()cout售t ;elsecoutgetda();coutbi.getyear()-bi.getmonth()-bi.getday()endl;p+;void admin:buy
33、fall()int count=0;int i;system(cls);cout樓盤(pán)編號(hào) 樓盤(pán)面積 樓盤(pán)租金 樓盤(pán)售金 樓盤(pán)狀態(tài) 租出/售出日期n;set:iterator p=fl.begin();while(p!=fl.end()count=count+1;p+;double r=100000000;for(i=0;icount;i+)double max=0;p=fl.begin();while(p!=fl.end()if(maxgetbuy()&rp-getbuy()max=p-getbuy();p+;r=max;p=fl.begin();while(p!=fl.end()if(max
34、=p-getbuy()cout getnum()t getsize()t gethire()t getbuy()getstate()cout售t ;elsecoutgetda();coutbi.getyear()-bi.getmonth()-bi.getday()endl;p+;void admin:sellsta()date firstday;firstday.set(1900,1,1); /起始日期默認(rèn)1900年1月1日date finalday;finalday.set(1900,1,1); /截至日期默認(rèn)1900年1月1日double money=0; /傭金計(jì)數(shù)int sc=0; /
35、售樓計(jì)數(shù)int hc=0; /租樓計(jì)數(shù)system(cls);cout查詢(xún)起始日期: n;firstday.input();cout查詢(xún)截至日期: n;finalday.input();set:iterator p=fl.begin();while(p!=fl.end()if(firstdaygetda()&p-getda()getstate()money=money+p-getbuy();sc=sc+1;elsemoney=money+p-gethire();hc=hc+1;p+;cout查詢(xún)時(shí)間段內(nèi)共n;cout售出: scendl;cout租出: hcendl;cout總金額: mone
36、yendl;cout傭金收入(中介費(fèi)3%): money*0.03endl;void admin:clientsta()int qz=0;int qs=0;int cz=0;int cs=0;int all=0;system(cls);set:iterator p=cl.begin();while(p!=cl.end()switch(p-gettype()case 1:qz=qz+1;all=all+1;break;case 2:qs=qs+1;all=all+1;break;case 3:cz=cz+1;all=all+1;break;case 4:cs=cs+1;all=all+1;break;p+;cout求租客戶(hù)數(shù)量: qzendl;cout求售客戶(hù)數(shù)量: qsendl;cout出租客戶(hù)數(shù)量: czendl;cout出售客戶(hù)數(shù)量: csendl;cout客戶(hù)總數(shù)量: allendl;void admin:savefloor(
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年黑龍江省單招職業(yè)傾向性測(cè)試題庫(kù)1套
- 第3單元第12課星期查詢(xún)-字符串函數(shù)和鍵盤(pán)輸入函數(shù)-教學(xué)設(shè)計(jì)2023-2024學(xué)年清華大學(xué)版(2012)初中信息技術(shù)九年級(jí)上冊(cè)
- 5-1《阿Q正傳(節(jié)選)》教學(xué)設(shè)計(jì) 2023-2024學(xué)年統(tǒng)編版高中語(yǔ)文選擇性必修下冊(cè)
- 2024-2025學(xué)年人教版(2024)七年級(jí)英語(yǔ)上冊(cè)寒假教學(xué)設(shè)計(jì)day 5
- 2024中廣核環(huán)保產(chǎn)業(yè)有限公司招聘7人筆試參考題庫(kù)附帶答案詳解
- 第四章 第3節(jié) 平面鏡成像2024-2025學(xué)年新教材八年級(jí)上冊(cè)物理新教學(xué)設(shè)計(jì)(人教版2024)
- 粵教版高中信息技術(shù)必修一1.2.2 信息技術(shù)的應(yīng)用與影響 教學(xué)設(shè)計(jì)
- 2025年湖北省省直轄行政單位單招職業(yè)適應(yīng)性測(cè)試題庫(kù)完美版
- 第五單元課題2 化學(xué)方程式教學(xué)設(shè)計(jì)-2024-2025學(xué)年九年級(jí)化學(xué)人教版(2024)上冊(cè)
- 2024下半年山東高速集團(tuán)有限公司校園招聘筆試參考題庫(kù)附帶答案詳解
- 2019石景山初三一模語(yǔ)文試題及答案
- 2021譯林版高中英語(yǔ)選擇性必修三課文翻譯
- 2022年華中科技大學(xué)博士研究生英語(yǔ)入學(xué)考試真題
- 《網(wǎng)店運(yùn)營(yíng)與管理》整本書(shū)電子教案全套教學(xué)教案
- 打印版 《固體物理教程》課后答案王矜奉
- CAD術(shù)語(yǔ)對(duì)照表
- 學(xué)術(shù)論文的寫(xiě)作與規(guī)范課件
- 香港牛津新魔法Newmagic3AUnit4Mycalendar單元檢測(cè)試卷
- 中考《紅星照耀中國(guó)》各篇章練習(xí)題及答案(1-12)
- Q∕GDW 11612.43-2018 低壓電力線(xiàn)高速載波通信互聯(lián)互通技術(shù)規(guī)范 第4-3部分:應(yīng)用層通信協(xié)議
- 自動(dòng)化物料編碼規(guī)則
評(píng)論
0/150
提交評(píng)論