《C++版酒店管理程序代码》

上传人:tang****xu5 文档编号:271134849 上传时间:2022-03-28 格式:DOCX 页数:5 大小:18.98KB
返回 下载 相关 举报
《C++版酒店管理程序代码》_第1页
第1页 / 共5页
《C++版酒店管理程序代码》_第2页
第2页 / 共5页
《C++版酒店管理程序代码》_第3页
第3页 / 共5页
《C++版酒店管理程序代码》_第4页
第4页 / 共5页
《C++版酒店管理程序代码》_第5页
第5页 / 共5页
亲,该文档总共5页,全部预览完了,如果喜欢就下载吧!
资源描述

《《C++版酒店管理程序代码》》由会员分享,可在线阅读,更多相关《《C++版酒店管理程序代码》(5页珍藏版)》请在金锄头文库上搜索。

1、程序代码N:最终改进版代码(利用结构体储存多种类型的数据)好处:比数组能储存更多类型的数据!#inclueiotram#nld#inclue/常用函数库ungnamesacestd;/在C+中tr和类的区别在于trut不能有方法,所有成员是publ的stuctRoomintNmber;inPrce;itSate;intdays;stigNme;strigPhone;strigID;/room;可以在声明struct的时候声明一个truc实例oomroom80;cssBooRoom/定义预定房间类房)private:stringName;intstaTi;/itromTye;/顾客姓名预定天数房

2、间类型(1标准单人间2大床房3.标准双人间4.套strigphneN;/预留手机号publc:oiseDat()(strinname;intime;intyp;tingnm;cou您好,请输入您的姓名:e;amnam;cou预定天数为:tm;stTie=ie;cout想要预定的房间类型:1.标准单人间00/天.大床房2/天3标准双人间300/天4套房400天enl;cn?ype;rmype=tpe;nu;phoeNm=num;ct预留手机号:;voidBok()(c正在预定roomype)(case1:f(ini=;iphoeNum;roomi.rce=this-tayme;cut?预定成功!

3、房间号:vromNumbervndl?endl;o.Stt=;brek;/已被预订号房间已有人enl;elecoutroomi.NuerstayTie;roo.ae=is-cNme;oom.Phne=thishneNum;roomi.Price=hi-taTim;cout预定成功!房间号:roomi.umerdlenl;om.State1;brak;esotoomiNumer号房间已有人endl;rak;case:fr(ini=40;isayTime;i.Name=this-cNam;oomPhnethshoeu;room.Prce*=this-stayTime;cou预定成功!房间号:rom

4、i.Numbeedendl;omi.St=;beak;eleoutoomi.Numer”号房间已有人cNme;roomi.Phnethishoneum;roomi.rce*thi-stayTime;cout预定成功!房间号:roi.Numberendldl;romitate=;break;lsecutromi.umbe”号房间已有人enl;brak;default:cou您输入的房间类型有误!endl;asChcIn/定义办理入住类(private:tngme;srincex;sringidum;身份证号tchec_inat;入住日期intstayme;nrmTye;strigpoeNu;pu

5、li:voidunbooed()strinnam;strings;stringidnu;iate;inttime;intpe;strnnm;cout客户姓名:name;cName=nam;cutex;cSe=sex;ut客户身份证号:idn;im=idnum;cou入住日期:dat;check_inDate=;cout占用天数:tie;stayTime=tim;cout房间类型:1.标准单人间100/天2.大床房20天.标准双人问300/天4套房00/天tpe;romTpe=ye;cout客户手机号:num;poumnu;swit(hs-oomTyp)cae1:or(nti=;cm;roomi

6、.oe=tis-phoneNu;rom.Price*=this-taTi;oomi.ID=tis-dNu;cut?入住成功!房间号:voomi.Numbervedl?endl;cou请支付200元押金endlenl;roomi.State=1;brak;elect抱歉,该房间类型没有了endl;bra;ce2:or(nt=2;tyTime;oomi.Nme=thisa;roomPhone=tis-poneNm;rooi.Price*=tis-tayTi;romi.ID=h-dNum;cout入住成功!房间号:romi.mberenndl;cou请支付00元押金enenl;roSae=1;bra

7、k;lseo抱歉,该房间类型没有了nl;brek;a:or(nt=4;istaTime;romi.am=this-Nme;rooi.Pone=tphoneNum;romiPrc*=hs-stayTme;romi.IDthis-idNm;cout入住成功!房间号:oi.Numberedlendl;cou请支付0元押金ede;rom.Stat=1;brea;esecou抱歉,该房间类型没有了endl;brek;case4:for(inti=60;itayTime;oomi.Nme=this-cNm;rooi.Phoethis-honeN;rooiPce*=tis-tayTime;oomi.ID=h

8、idNum;out入住成功!房间号:roomiNumberendlendl;cu请支付800元押金edlenl;roomi.te=1;ak;lsecut抱歉,该房间类型没有了el;beak;dfult:cou您输入的房间类型有误!enl;vibokd()stringcompareIte;stringd_num;co请输入您的姓名或者手机号:cpareItm;for(inti=;om.Pice)cu请补交(expen-rmi.Pice)nd;brak;元endl;esot?退回:(room.Priceexne)elcotomiumbr号房不符合enl;out房费核算清后请安任点键继续ndedl;system(pa);cot感谢入住本酒店,欢迎下次光临!endnl;vidmeu()cot欢迎使用酒店

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 办公文档 > 工作计划

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号