1、int State;int days;string Name;string Phone;string ID;/room; 可以在声明struct的时候声明一个struct实例Room room80;class BookRoom /定义预定房间类 private:string cName; /顾客姓名int stayTime; /预定天数int roomType; /房间类型(1.标准单人间 2.大床房 3.标准双人间 4. 套房)string phoneNum; / 预留手机号public: void setData() string name; int time; int type; str
2、ing num; coutname; cName=name;couttime; stayTime=time;想要预定的房间类型:1.标准单人间 100/天 2.大床房 200/天 3.标准双人间 300/天 4.套房400/天type; roomType=type;预留手机号:num; phoneNum=num;void Book()正在预定.switch(this-roomType)case 1:for(int i=0;istayTime;roomi.Name=this-cName;roomi.Phone=this-phoneNum;roomi.Price*=this-cout预定成功!房间号:roomi.Numberendlroomi.State=1;break; /已被预订 else cout roomi.Name=this- cout break; else coutcase 3:for(int i=40;60;if(roomi.State=0)case 4:for(int i=60;80;else coutdefault:coutidNum;入住成功!请支付200元押金break;抱歉,该房间类型没有了请支付400元押金请支付600元押金roo