




下載本文檔
版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
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)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 中央戲劇學院《生物信息學入門(雙語)》2023-2024學年第二學期期末試卷
- 廈門演藝職業(yè)學院《雅思實戰(zhàn)精練》2023-2024學年第二學期期末試卷
- 西北師范大學《海外中國史研究》2023-2024學年第二學期期末試卷
- 鄭州食品工程職業(yè)學院《醫(yī)學基礎(下)》2023-2024學年第二學期期末試卷
- 貴州大學《藥廠設備及車間工藝設計》2023-2024學年第二學期期末試卷
- 運城職業(yè)技術大學《建筑設計與園林藝術》2023-2024學年第二學期期末試卷
- 江海職業(yè)技術學院《種子工程與技術》2023-2024學年第二學期期末試卷
- 曲靖師范學院《心理學論文寫作方法》2023-2024學年第二學期期末試卷
- 蛋白質(zhì)基生物塑料開發(fā)-洞察及研究
- 空間不平等等級分析-洞察及研究
- Dahua大華7系報警柱快速操作手冊
- 《限額以下小型工程施工安全管理辦法(試行)》知識培訓
- 廣西申論真題2021年(B卷)
- 國家職業(yè)技術技能標準 4-04-05-05 人工智能訓練師 人社廳發(fā)202181號
- GB/T 44442-2024智能制造遠程運維系統(tǒng)評價指標體系
- 國開建筑工程技術實踐
- 延長石油招聘筆試題庫
- 廣東省深圳市龍崗區(qū)多校聯(lián)考2024年統(tǒng)編版小升初考試語文試卷(解析版)
- 2023年北京第二次高中學業(yè)水平合格考化學試卷真題(含答案詳解)
- 02R111小型立、臥式油罐圖集
- 2024屆廣州市南沙區(qū)數(shù)學五年級第二學期期末監(jiān)測模擬試題含解析
評論
0/150
提交評論