C版酒店管理程序代码Word文件下载.docx
《C版酒店管理程序代码Word文件下载.docx》由会员分享,可在线阅读,更多相关《C版酒店管理程序代码Word文件下载.docx(25页珍藏版)》请在冰豆网上搜索。
intState;
intdays;
stringName;
stringPhone;
stringID;
};
//room;
可以在声明struct的时候声明一个struct实例
Roomroom[80];
classBookRoom//定义预定房间类
private:
stringcName;
//顾客姓名
intstayTime;
//预定天数
introomType;
//房间类型(1.标准单人间2.大床房3.标准双人间4.套房)
stringphoneNum;
//预留手机号
public:
voidsetData()
{
stringname;
inttime;
inttype;
stringnum;
cout<
<
"
您好,请输入您的姓名:
endl;
cin>
>
name;
cName=name;
cout<
预定天数为:
cin>
time;
stayTime=time;
想要预定的房间类型:
1.标准单人间100/天2.大床房200/天3.标准双人间300/天4.套房400/天"
type;
roomType=type;
预留手机号:
num;
phoneNum=num;
};
voidBook()
{
正在预定..."
switch(this->
roomType)
{
case1:
for(inti=0;
i<
20;
i++)
{
if(room[i].State==0)//房间无人占用且无人预定
{
room[i].days=this->
stayTime;
room[i].Name=this->
cName;
room[i].Phone=this->
phoneNum;
room[i].Price*=this->
cout<
预定成功!
房间号:
room[i].Number<
endl<
room[i].State=1;
break;
//已被预订
}
elsecout<
号房间已有人"
}break;
case2:
for(inti=20;
40;
if(room[i].State==0)
{
room[i].days=this->
room[i].Name=this->
cout<
break;
elsecout<
case3:
for(inti=40;
60;
if(room[i].State==0)
case4:
for(inti=60;
80;
elsecout<
default:
cout<
您输入的房间类型有误!
}
classCheckIn//定义办理入住类
stringcSex;
stringidNum;
//身份证号
intcheck_inDate;
//入住日期
intstayTime;
introomType;
stringphoneNum;
voidunbooked()
stringname;
stringsex;
stringidnum;
intdate;
inttime;
inttype;
stringnum;
客户姓名:
客户性别:
sex;
cSex=sex;
客户身份证号:
idnum;
idNum=idnum;
入住日期:
date;
check_inDate=date;
占用天数:
stayTime=time;
房间类型:
1.标准单人间100/天2.大床房200/天3.标准双人间300/天4.套房400/天"
roomType=type;
客户手机号:
if(room[i].State==0){
room[i].ID=this->
idNum;
入住成功!
请支付200元押金"
break;
抱歉,该房间类型没有了"
请支付400元押金"
请支付600元押金"
roo