賓館客房信息管理系統(tǒng)_第1頁
賓館客房信息管理系統(tǒng)_第2頁
賓館客房信息管理系統(tǒng)_第3頁
賓館客房信息管理系統(tǒng)_第4頁
賓館客房信息管理系統(tǒng)_第5頁
全文預覽已結束

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內(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. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論