資源簡介
C++ 寫客房管理系統,代碼無錯誤,含詳細說明和開發論文

代碼片段和文件信息
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
using?namespace?std;
struct??date??//日期
{
int?year;
int?month;
int?day;
int?house;
int?minute;
}?;?
struct?Room????//房間結構體
{
int?number;?//房號?每層10給房?一個類型房間號如:101到110?801到810
int?type;???//房型?1、標準單人房(100¥/晚)?2、標準雙人房(180¥/晚)?3、豪華單人房(150¥/晚)?4、豪華雙人房(250¥/晚)?5、行政房(200¥/晚)?6、商務房(200¥/晚)?7、家庭間(250¥/晚)?8、蜜月間(250¥/晚)
double?price;??//價格
int?state;??//狀態?0空閑,1預訂?2已入住
};
class??CustomerNode???//顧客節點
{?
public:
CustomerNode(){};
CustomerNode(int?type);
char?name[20];???//姓名
char?ID[18];?????//身份證號碼
char?zhiye[30];?????//職業
int??roomNumber;???//入住房號
int?roomType;??????//入住房型
int?bookTotal;?????//預訂套數
char?sex;????????//性別
int?age;
date?inDate;?????????//入住時間
date?outDate;???????//離開時間
CustomerNode?*next;
};
class?CustomerList{??????
public:
CustomerList(){??head=tail=0;??};
void??insert(?CustomerNode?*p);
void?deleteNode(CustomerNode?*tempCustomerNode?*p);
CustomerNode?*head*tail;
};
CustomerList?lst2;????//鏈表2存放預訂信息
CustomerList?lst;??????//鏈表存放顧客入住信息
void?CustomerList::insert(CustomerNode?*p){??//插入在頭結點
p->next=head;
head=p;
}
void?CustomerList::deleteNode(CustomerNode?*tempCustomerNode?*p){????//刪除
if(p->next==0?&&?temp!=p)?{temp->next=0;???delete(p);}
else{
if(temp==p)?{
p=p->next;
lst2.head=lst2.head->next;
// delete(p);
}
else{
temp->next?=?p->next;
delete(p);
}
}
}
CustomerNode::CustomerNode(int?type)?//構造函數
{???
roomType=type;
cout<<“請輸入顧客姓名:“;
cin>>name;
while(1){
cout<<“請您輸入顧客的身份證號碼(18位):?“;?
cin>>ID;
if(strlen(ID)==18)?break;
else?cout<<“請正確輸入身份證號碼!“< }
cout<<“請輸入顧客年齡:“;
cin>>age;
cout<<“請輸入顧客職業:“;
cin>>zhiye;
while(1){
cout<<“請輸入顧客性別(f/m):“;
cin>>sex;
if(sex==‘f‘||sex==‘m‘)?break;
else?cout<<“請正確輸入性別!“< }
time_t?t?=?time(NULL);
tm*?pt?=?localtime(&t);
inDate.year?=?1900?+?pt->tm_year;
inDate.month?=?pt->tm_mon?+?1;
inDate.day?=?pt->tm_mday;
inDate.house?=?pt->tm_hour;
inDate.minute?=?pt->tm_min;
//next?=?ptr;
//??cout<<1900?+?pt->tm_year<<‘-‘<tm_mon?+?1<<‘-‘<tm_mday<<‘?‘<tm_hour<<‘:‘<tm_min<<‘:‘<tm_sec<<‘\n‘;
};
int?totalroom=80;????//酒店總房間數
Room?room[811];???//全局變量
string?roomTypeNames[9]?=?{“oo““標準單人房““標準雙人房““豪華單人房““豪華雙人房““行政房““商務房““家庭間““蜜月間“};
int?totalday[13]?=?{0312931303130313130313031};
//登錄函數
int?password(){
int?flag=1;
string?passname;
string?passwords;
for(int?i=0;i<3;i++){
cout<<“請輸入用戶名(初始用戶000):“;
cin>>passname;
cout<<“請輸入密碼(初始密碼000):“;
cin>>passwords;
if(passname==“000“&&passwords==“000“){???????//初始密碼為000??000??進入系統后可以修改
flag=0;
return?1;
break;
}
else{
cout<<“輸入錯誤!請重試“< }
}system(“cls“);
if(flag==0){
return?0;}
system(“cls“);
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????49??2011-09-08?08:18??客房管理系統(含一萬字論文)\debug\CustomerBookInformation.txt
?????文件????????614??2011-09-07?20:12??客房管理系統(含一萬字論文)\debug\CustomerInformation.txt
?????文件??????????0??2011-09-07?20:33??客房管理系統(含一萬字論文)\debug\manage.txt
?????文件???????1040??2011-09-07?20:12??客房管理系統(含一萬字論文)\debug\RoomInformation.txt
?????文件?????217088??2011-09-08?08:15??客房管理系統(含一萬字論文)\debug\客房管理系統.exe
?????文件?????????38??2011-11-04?11:59??客房管理系統(含一萬字論文)\客房管理系統\CustomerBookInformation.txt
?????文件????????584??2011-11-04?11:59??客房管理系統(含一萬字論文)\客房管理系統\CustomerInformation.txt
?????文件???????8906??2011-09-08?08:15??客房管理系統(含一萬字論文)\客房管理系統\Debug\BuildLog.htm
?????文件?????????67??2011-09-08?08:15??客房管理系統(含一萬字論文)\客房管理系統\Debug\mt.dep
?????文件?????101376??2011-09-08?08:15??客房管理系統(含一萬字論文)\客房管理系統\Debug\vc80.idb
?????文件????????145??2011-09-08?08:15??客房管理系統(含一萬字論文)\客房管理系統\Debug\客房管理系統.exe.intermediate.manifest
?????文件?????335775??2011-09-08?08:15??客房管理系統(含一萬字論文)\客房管理系統\Debug\客房管理系統.obj
?????文件??????????7??2011-11-04?12:00??客房管理系統(含一萬字論文)\客房管理系統\manage.txt
?????文件???????1040??2011-09-08?08:15??客房管理系統(含一萬字論文)\客房管理系統\RoomInformation.txt
?????文件??????23800??2011-09-08?08:17??客房管理系統(含一萬字論文)\客房管理系統\客房管理系統.cpp
?????文件???????3051??2011-08-29?21:56??客房管理系統(含一萬字論文)\客房管理系統\客房管理系統.vcproj
?????文件???????1427??2011-09-08?08:17??客房管理系統(含一萬字論文)\客房管理系統\客房管理系統.vcproj.MICROSOF-A0E2F2.Administrator.user
?????文件????2337792??2011-09-08?08:17??客房管理系統(含一萬字論文)\客房管理系統.ncb
?????文件????????919??2011-08-29?21:53??客房管理系統(含一萬字論文)\客房管理系統.sln
????..A..H.?????13824??2011-09-08?08:17??客房管理系統(含一萬字論文)\客房管理系統.suo
?????文件?????963584??2011-11-04?11:58??客房管理系統(含一萬字論文)\論文.doc
?????目錄??????????0??2011-11-04?11:56??客房管理系統(含一萬字論文)\客房管理系統\Debug
?????目錄??????????0??2011-11-04?11:56??客房管理系統(含一萬字論文)\debug
?????目錄??????????0??2011-11-04?11:56??客房管理系統(含一萬字論文)\客房管理系統
?????目錄??????????0??2011-11-04?11:59??客房管理系統(含一萬字論文)
-----------?---------??----------?-----??----
??????????????4011126????????????????????25
- 上一篇:信號FFT變換及繪圖
- 下一篇:井字棋 α-β剪枝算法
評論
共有 條評論