




下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、#include #include #include using namespace std;class list;class roomfriend class list;private:char num8;int capacity;int grade;double price;int checked;public:room():checked(0);int checkIn(int n);int room:checkIn(int n)if(n+checkedcapacity) return 0;checked+=n;return 1;class nodefriend class list;pr
2、ivate:room r;node *next,*last;public: ;class listprivate:node *head,*tail;public:list();list();void showTitle();void show(node *);void display();void insert(node *);void setData(node *);void add();void modi();node *qur(int);void menu();void select();void save();void list:showTitle()cout房間號t容量t檔次t價格t
3、已入住endl;void list:show(node *p)coutr.numtr.capacitytr.gradetr.pricetr.checkednext;showTitle();while(p!=tail)show(p);p=p-next;system(pause);void list:insert(node *p)node *q=head-next;while(q!=tail) if(strcmp(p-r.num,q-r.num)last=q;p-next=q-next;q-next-last=p;q-next=p;break;q=q-next;if(q=tail)p-next=t
4、ail;p-last=tail-last;tail-last-next=p;tail-last=p;void list:setData(node *p)int n;coutp-r.num;coutp-r.capacity;coutp-r.grade;coutp-r.price;coutn;if(!p-r.checkIn(n) cout容量不足,請重新輸入!endl;else break; while (1);void list:add()char ch;dosystem(cls);node *p=new node;setData(p);insert(p);coutch;while(ch!=y&
5、ch!=Y);node *list:qur(int method)if(method!=1)coutmethod;node *p=head-next;if(method=1)char num8;coutnum;while(p!=tail&strcmp(p-r.num,num)!=0) p=p-next;else if(method=2)int c;coutc;while(p!=tail) if(p-r.capacity=c) show(p);p=p-next;system(pause);system(cls);return NULL;return p;void list:modi()node
6、*p=qur(1);if(p=tail) cout未找到endl;system(pause);else setData(p);void list:save()ofstream out;out.open(d:info.txt,ios:out);if(!out)cerr保存失敗endl;system(pause);return;out房間號t容量t檔次t價格t已入住next;while(p!=tail)outr.numtr.capacitytr.gradetr.pricetr.checkednext;out.close();void list:menu()cout*賓館信息管理*endl* *en
7、dl* 1.瀏覽 *endl* 2.添加 *endl* 3.修改 *endl* 4.查詢 *endl* 5.退出 *endl* *endl*endl;void list:select()int n;do system(cls);menu();coutn;switch(n)case 1:display();break;case 2:add();break;case 3:modi();break;case 4:node *p=qur(2);if(p=tail) cout未找到next=tail;head-last=NULL;tail-last=head;tail-next=NULL;list:list()node* p=head-next;while(p!=t
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 漢字找茬活動方案
- 水果小班活動方案
- 樓盤品茶活動方案
- 株洲風(fēng)箏活動方案
- 歙縣三陽鎮(zhèn)活動方案
- 漢服比賽活動方案
- 母親節(jié)好歌傳唱活動方案
- 氣球裝飾公司活動方案
- 比基尼選秀活動方案
- 漢語課堂活動方案
- 高速收費(fèi)站消防安全培訓(xùn)
- 數(shù)控維修面試試題及答案
- 門診診室管理制度模板
- DB31-T 1564-2025 企業(yè)實(shí)驗(yàn)室危險(xiǎn)化學(xué)品安全管理規(guī)范
- 建筑學(xué)專業(yè)創(chuàng)新型人才培養(yǎng)模式的構(gòu)建與實(shí)踐研究
- 工程造價司法鑒定實(shí)施方案
- 水廠反沖洗排泥水處理工藝流程
- 2024年紹興市鏡湖開發(fā)集團(tuán)有限公司下屬國企招聘筆試真題
- 《常用音頻接口介紹》課件:深入了解各種音頻接口的特點(diǎn)與應(yīng)用
- 2025年山西航空產(chǎn)業(yè)集團(tuán)有限公司招聘筆試參考題庫含答案解析
- 構(gòu)建博物館研學(xué)教育的新模式
評論
0/150
提交評論