![小區(qū)物業(yè)管理系統(tǒng)C課程設(shè)計(jì)_第1頁](http://file3.renrendoc.com/fileroot_temp3/2022-3/27/f55a53ae-bd4d-4e88-8c3f-d6a26eee78ca/f55a53ae-bd4d-4e88-8c3f-d6a26eee78ca1.gif)
![小區(qū)物業(yè)管理系統(tǒng)C課程設(shè)計(jì)_第2頁](http://file3.renrendoc.com/fileroot_temp3/2022-3/27/f55a53ae-bd4d-4e88-8c3f-d6a26eee78ca/f55a53ae-bd4d-4e88-8c3f-d6a26eee78ca2.gif)
![小區(qū)物業(yè)管理系統(tǒng)C課程設(shè)計(jì)_第3頁](http://file3.renrendoc.com/fileroot_temp3/2022-3/27/f55a53ae-bd4d-4e88-8c3f-d6a26eee78ca/f55a53ae-bd4d-4e88-8c3f-d6a26eee78ca3.gif)
![小區(qū)物業(yè)管理系統(tǒng)C課程設(shè)計(jì)_第4頁](http://file3.renrendoc.com/fileroot_temp3/2022-3/27/f55a53ae-bd4d-4e88-8c3f-d6a26eee78ca/f55a53ae-bd4d-4e88-8c3f-d6a26eee78ca4.gif)
![小區(qū)物業(yè)管理系統(tǒng)C課程設(shè)計(jì)_第5頁](http://file3.renrendoc.com/fileroot_temp3/2022-3/27/f55a53ae-bd4d-4e88-8c3f-d6a26eee78ca/f55a53ae-bd4d-4e88-8c3f-d6a26eee78ca5.gif)
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、#include#include#include#include#includeusing namespace std;class livers/livers 類 private:char name20; / 姓名char sex;char room_num10;char parking10;char ID_num20;char phone_num20;public:livers()livers(char n20,char s,char room10,char park10,char phone20,char ID20) strcpy(name,n);sex=s;strcpy(room_num
2、,room);strcpy(parking,park);strcpy(phone_num,phone);strcpy(ID_num,ID);friend void menu();/ 友元函數(shù);void key() char mima20,key20;char yu_mima20=12345;int flag;int p;char w;ifstream in;ofstream out;fstream f; / 輸入輸出對(duì)象cout*endl;cout歡迎登錄小區(qū)物業(yè)管理系統(tǒng)endl;cout*endlendl;doflag=0;cout請(qǐng)輸入管理員密鑰:endl;in.clear();in.op
3、en(E:c.dat,ios:in);if(in.fail() / 首次登錄coutendl歡迎首次登錄,您的預(yù)設(shè)密碼為12345:endlendl;coutmima;coutendl;if(strcmp(yu_mima,mima)=0)flag=1;cout 密碼正確!請(qǐng)輸入下一步指令:endlkey;cinmima;if(strcmp(key,mima)=0)flag=1;cout 密碼正確!請(qǐng)輸入下一步指令:endlendl; in.close();if(flag=0)cout 密碼有誤,請(qǐng)重新輸入 endlendl;while(flag=0);cout*”end;cout*0、修改密碼
4、*endl;cout*1、進(jìn)入系統(tǒng)*endl;cout*2、退出系統(tǒng)*endl;cout do*endlendl;do請(qǐng)輸入您的指令(0-2):endl;cout cinp;switch(p)(case 0:/修改密碼cout請(qǐng)輸入新密碼:endl;cinkey;out.open(E:c.dat,ios:out);out.clear();outkey;out.close();break;case 1: menu();break;/ 進(jìn)入系統(tǒng)case 2: 退出系統(tǒng)cout 謝謝使用,小區(qū)物業(yè)管理系統(tǒng) ! endlendl Bye-bye!See you next time!endlendl;e
5、xit(O);break;default: cout輸入指令有誤,請(qǐng)重新輸入 :endlendl;break;)while(p2);cout您想繼續(xù)進(jìn)行其他操作嗎?y / n :endldocinw;coutendl;if(w=n)exit(0);if(w!=y&w!=n)cout 指令錯(cuò)誤!請(qǐng)重新輸入!endl;while(flag=0);if(w=y)cout請(qǐng)輸入操作代碼:0修改密碼endl;cout1 進(jìn)入系統(tǒng)endl;cout2 退出系統(tǒng)endl;while(w=y);密鑰函數(shù)cout* endl;cout*主菜單命令如下所示:*endl;cout*1 、輸入數(shù)據(jù)*endl;cout
6、*2、增加數(shù)據(jù)*endl;cout*3、修改數(shù)據(jù)*endl;cout*4、信息查詢*endl;cout*5、信息瀏覽*endl;cout*6、信息刪除*endl;cout*7、退出系統(tǒng)*endl;cout* endl;void menu()coutcoutcout* endl;小區(qū)物業(yè)管理系統(tǒng)*endl;endl;cout請(qǐng)輸入您的指令數(shù)字(17) endlp;if(p=1&p=7)flag=1;else cout while(flag=指令錯(cuò)誤!請(qǐng)重新輸入:endl;=0);do/ 最外層循環(huán) switch(p) /接收功能選項(xiàng) (case 1: 信息輸入char name20,sex,ro
7、om_num10,parking10,phone_num20,ID_num20,c;out.open(E:a.dat,ios:out);docoutname;coutendlsex;coutendlroom_num;coutendlparking;coutendlphone_num;coutendlID_num; coutendl;outsetw(20)namesetw(5)sexsetw(10)room_numsetw(10)parkingsetw(20)phone_numsetw(20)ID_num;/ 文件輸入cout數(shù)據(jù)輸入成功,想繼續(xù)輸入嗎?y / n : endlc;coutend
8、l;do if(c!=y&c!=n) cout 指令錯(cuò)誤!請(qǐng)重新輸入!endlc;else flag=1;while(flag=0);while(c=y);out.close();break;case 2:/增加數(shù)據(jù)char name20,sex,room_num10,parking10,phone_num20,ID_num20,c;out.open(E:a.dat,ios:app); do(cout請(qǐng)輸入您要增加的住戶的姓名:endl;cinname;coutendl 請(qǐng)輸入住戶性別:;cinsex;coutendl 請(qǐng)輸入其房間號(hào):;cinroom_num;coutendl 請(qǐng)輸入其車庫號(hào)
9、:;cinparking;coutendl 請(qǐng)輸入聯(lián)系電話:;cinphone_num;coutendl 請(qǐng)輸入身份證號(hào):;cinID_num;coutendl;outsetw(20)namesetw(5)sexsetw(10)room_numsetw(10)parkingsetw(20)phone_numsetw(20)ID_num;/ 文件輸入cout 數(shù)據(jù)添加成功,想繼續(xù)添加嗎?y/n :endl;cinc;coutendl;if(c=n)break;if(c!=y&c!=n)cout 指令錯(cuò)誤!請(qǐng)重新輸入!endlcinc;while(c=y);out.close();break;/修
10、改數(shù)據(jù)) case 3:char name20,sex,room_num10,parking10,phone_num20,ID_num20,c;char na20,s,room10,park10,phone20,ID20;doint flag=0;cout 請(qǐng)輸入您要修改的住戶的姓名:na;coutname;if(strcmp(name,na)=0)flag=1;cout請(qǐng)輸入您要修改的住戶的姓名:na;coutroom; coutendls;coutendlroom;coutendlpark;coutendlphone; coutendlID;請(qǐng)輸入住戶性別請(qǐng)輸入其房間號(hào)請(qǐng)輸入其車庫號(hào)請(qǐng)輸入
11、聯(lián)系電話請(qǐng)輸入身份證號(hào)coutendl;sex=s;strcpy(room_num,room);strcpy(parking,park);strcpy(ID_num,ID);strcpy(phone_num,phone);f.seekp(-20l,ios:cur);fsetw(20)nasetw(5)ssetw(10)roomsetw(10)parksetw(20)phonesetw(2 0)ID;/文件輸入cout修改成功! endlendl;break;f.close();if(flag=0)cout 您要修改的學(xué)生不存在!endlendl;cout 您想繼續(xù)修改嗎?y / n :c;co
12、utendl;if(c=n)break;if(c!=y&c!=n)cout 指令錯(cuò)誤!請(qǐng)重新輸入!endlc;while(c=y);break;case 4:/ 信息查詢char name20,sex,room_num10,room10,parking10,phone_num20,ID_num20;cout 請(qǐng) 選 擇 您 要 進(jìn) 行 查 詢 的 方 式 : endlendl 1. 按 住 戶 名 查 詢 endlendl 2.按房間號(hào)查詢endlk;switch(k)case 1 / 按住戶名查詢char na20;char c;doin.open(E:a.dat,ios:in);in.se
13、ekg(0,ios:beg);in.clear();int flag=0;cout 請(qǐng)輸入你要查詢的住戶姓名:na;coutnamesexroom_numparkingphone_numID_num;if(strcmp(name,na)=0)flag=1;cout 您要查詢的住戶:name的信息是:endlendl;cout姓名 性別 房間號(hào) 車庫號(hào)電話號(hào)碼身份證號(hào)endl;coutsetw(2)namesetw(5)sexsetw(10)room_numsetw(10)parkingsetw(20)phone_numsetw(20)ID_numendl;in.close();if(flag=
14、0)cout 對(duì)不起!您要查詢的住戶不存在 !endlendl;coutc;coutendl;if(c=n)break;if(c!=y&c!=n)cout 指令錯(cuò)誤!請(qǐng)重新輸入!c;while(c=y);break;case 2 :/按房間號(hào)查詢 do int flag=0;cout 請(qǐng)輸入你要查詢的房間號(hào) :room;coutnamesexroom_numparkingphone_numID_num;if(strcmp(room_num,room)=0)flag=1;cout您要查詢的住戶:name的信息是:endlendl;cout姓名 性別 房間號(hào) 車庫號(hào)電話號(hào)碼身份證號(hào)endl;cou
15、tsetw(2)namesetw(5)sexsetw(10)room_numsetw(10)parkingsetw(20)phone_numsetw(20)ID_numendl;)in.close();if(flag=0)cout 對(duì)不起!您要查詢的住戶不存在!endl;coutc;coutendl;if(c=n)break;if(c!=y&c!=n)cout 指令錯(cuò)誤!請(qǐng)重新輸入!c;while(c=y);break;default:cout對(duì)不起,您輸入白指令有誤:;break;break;case 5:信息瀏覽char name20,sex,room_num10,parking10,ph
16、one_num20,ID_num20;in.open(E:a.dat,ios:in);in.seekg(0,ios:beg);in.clear();if(in.get()=EOF)cout文件中已無數(shù)據(jù)endlendl;in.close();break;cout 本系統(tǒng)所有學(xué)生數(shù)據(jù)如下:endlendl;cout姓名 性別 房間號(hào)車庫號(hào)電話號(hào)碼身份證號(hào)namesexroom_numparkingphone_numID_num;coutsetw(2)namesetw(5)sexsetw(10)room_numsetw(10)parkingsetw(20) phone_numsetw(20)ID_
17、numendl;in.close();break;case6:/信息刪除char name20,na20,sex,room_num10,parking10,phone_num20,ID_num20,c;int k;doint n=0;int flag=0;cout 請(qǐng)輸入您要?jiǎng)h除的學(xué)生的姓名:na;coutnamesexroom_numparkingphone_numID_num;sn=new livers(name,sex,room_num,parking,phone_num,ID_num);livn=*sn;delete sn;n+;in.close();for(i=0;i1)for(i=
18、0;ik;i+)outsetw(2)setw(5)livi.sexsetw(10)livi.room_numsetw(10)livi.p arkingsetw(20)livi.phone_numsetw(20)livi.ID_num;for(i=k+1;in;i+)outsetw(2)setw(5)livi.sexsetw(10)livi.room_numsetw(10)livi.p arkingsetw(20)livi.phone_numsetw(20)livi.ID_num;cout信息刪除成功endlendl;)if(n=1) out.close();)elsecout 您要?jiǎng)h除的住戶不存在!endlendl;cout 您想繼續(xù)刪除嗎?y / n :endl;cinc;coutendl;if(c=n)break;if(c!=y&c!=n)cout 指令錯(cuò)誤!請(qǐng)重新輸入! endlcinc;while(c=y);break;)case7:/ 退出coutBye bye! See you next time.endlendl;cout王建制作endlendlendl;exit(O); break;/以上為menu菜單中switch控制語句cout 您想繼續(xù)進(jìn)行其他操作嗎?
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 【正版授權(quán)】 ISO/IEC 14888-4:2024 EN Information security - Digital signatures with appendix - Part 4: Stateful hash-based mechanisms
- 2025年充電樁充電設(shè)備生產(chǎn)許可證申請(qǐng)與審批合同
- 2025年度新能源汽車充電樁建設(shè)與運(yùn)營服務(wù)合同-@-3
- 2024 年度中國汽車行業(yè)爭議解決報(bào)告
- 2025年度小時(shí)工維修養(yǎng)護(hù)服務(wù)合同范本
- 2025年度知識(shí)產(chǎn)權(quán)保險(xiǎn)產(chǎn)品代理與服務(wù)合同
- 2025年心電遙測監(jiān)護(hù)儀項(xiàng)目合作計(jì)劃書
- 英語-黑龍江省大慶市實(shí)驗(yàn)中學(xué)2024-2025學(xué)年高一上學(xué)期階段考試
- 2025年瀝青試驗(yàn)儀器項(xiàng)目合作計(jì)劃書
- 2025年度走讀生戶外活動(dòng)安全責(zé)任承諾協(xié)議范本
- 基礎(chǔ)護(hù)理學(xué)試題及答案(各章節(jié))-基礎(chǔ)護(hù)理學(xué)第四版試題及答案
- 色彩發(fā)展的歷史課件
- (2023年最新版)醫(yī)師執(zhí)業(yè)、變更執(zhí)業(yè)、多機(jī)構(gòu)備案申請(qǐng)審核表
- 醫(yī)療器械臨床試驗(yàn)質(zhì)量管理規(guī)范培訓(xùn)課件
- 氣流粉碎機(jī)課件
- SJG 74-2020 深圳市安裝工程消耗量定額-高清現(xiàn)行
- GB∕T 41097-2021 非公路用旅游觀光車輛使用管理
- 鐵路乘車證管理辦法
- 軟件項(xiàng)目立項(xiàng)開發(fā)工作流程圖
- 叉車設(shè)備點(diǎn)檢表
- 三方聯(lián)測測量記錄表
評(píng)論
0/150
提交評(píng)論