酒店管理系统代码

上传人:pu****.1 文档编号:498250127 上传时间:2023-04-21 格式:DOCX 页数:28 大小:27.73KB
返回 下载 相关 举报
酒店管理系统代码_第1页
第1页 / 共28页
酒店管理系统代码_第2页
第2页 / 共28页
酒店管理系统代码_第3页
第3页 / 共28页
酒店管理系统代码_第4页
第4页 / 共28页
酒店管理系统代码_第5页
第5页 / 共28页
点击查看更多>>
资源描述

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

1、酒店管理系统代码ttinelude windowsh #include #includestdioh #include #include/ 结 构 定 义typedef struct Checkininformation char name10;int id;件号int roomType;int countType; Checkininfo;姓名证房型 计费方式typedef struct HotelRoom int roomType;房型int roomNum;/房号int checked;入住情况int price;/房价Room;typedef struct RoomOrderCheck

2、ininfo *checkinlnfo; 息long/入住时间Room * room;房间信息Order;/入住信 date;/typedef struct HotellnfomationintcheckinAmount;已入住房数int singleRemainAmount;/单人房剩余房数int doub 1 eRemainAmount;/双人房剩余房数/大床int bigRemainAmount; 房剩余房数Hotellnfo;/枚举类型 enumMainUI, HotellnfoUI, CheckinUI, CheckinResu ItUI, OrderUI, CheckOutUI,

3、Exit:/GUI enum Single, Double, Big;/Room Type enum Hour, Day;/countType/量全局变int GUI 二 MainUI:Order* orderList 100; 订单数组Room* roomList 100;/房间数组Hotelinfo * hotelinfo 二 NULL;/酒店房间信 息/函数声明void initiallizeRoomList();void insertToOrderList(Order * order);Room* getRoomByType(int roomType); Order* getOrder

4、ByRoomNum(int roomNum);void showMainUI。;void showH otelInfoUI。;void showCheckinUI。;void showCheckinResultUI();void showOrderUI();void showCheckOutUI。;/数void/主函数hotelInfo-Main 函 main()(HotelInfo*)malloc(sizeof(Hotelinfo);hotelinfo 一 singleRemainAmount 二 20;hotelInfo - doubleRemainAmount=40;hotelInfo

5、- bigRemainAmount=40;hotelInfo - checkinAmount=0;初始化房间列表initiallizeRoomList();界面显示wh订e(GUI != Exit)swi tch(GUI)case MainUI:showMainUI。;break;case HotelInfoUI:showHo telInfoUIO;break;case CheckinUI:showCheckinUIO;break;case CheckinResultUI: showCheckinResultUI(); break;case OrderUI: showOrderUI(); br

6、eak;case CheckOutUI: showCheckOutUI(); break;default:break;/函数定义void initiallizeRoomList()房间数组初始化,初始化的结果是让roomList的数组有100个room指针,而且设置 了相应的值int i;Room*newRoom二NULL;for(i=0;i20;i+)/ 单人房房间信息初始化newRoom=(Room* )malloc(sizeof(Room);roomListi二 newRoom;roomListi-checked=0;roomListi-price=110;roomListi-roomN

7、um二i+1;roomListi-roomType二Single;for(i=20;i60;i+)/ 双人房房间信息初始化newRoomz(Room* )malloc(sizeof(Room);roomListi二 newRoom;roomListi-checked=0;roomListi-price=180;roomListi-roomNum二i+1;roomListi-roomType二Double;for(i=60;i100;i+)/ 大床房房间信息初始化newRoom=(Room* )malloc(sizeof(Room);roomListi二 newRoom;roomListi-ch

8、ecked=0;roomListi-price=180;roomListi-roomNum二i+1;roomListi-roomType二Big;通过所选择的房型获取空房间,获取房间后将 房间信息改为已入住,并减少相应房型的剩余房 间数Room* getRoomByType(int roomType)int i;switch(roomType)case Single:for(i=0;isingleRemainAmount hotelInfo-checkinAmount+; return roomListi;break;case Double:for(i=20;idoubleRemainAmou

9、ntIhotelInfo-checkinAmount+; return roomListi;break;case Big:for(i=60;i100;i+)if( roomListi-checked = 0)roomListi-checked=1;hotelInfo-bigRemainAmount -一;hotelInfo-checkinAmount+; return roomListi;寅必咲皐合皆联藝/!jopjo 二iq.siqj9pjo (TlflN二二!再!卩即工0 )jt (+T-00IT-0 二!)珂T HE (jspjo * jspjg) siqjopjo0!-18811! P

10、!OA 峯fi&庚必Y龔庚必#k/Order* getOrderByRoomNum(int roomNum)int i;for(i=0;iroomNum roomNum)return orderListi; void showMainUI。显示主界面,并接受输入int chooseNum;sys te m(cls);printf(nn二二= 酒店房间登记与计费管理管理系统printf(*tttt1 tttt*n);printf(*tttt2 ttt*n);printf(*tttt3 ttt*n);printf(*tttt4 tttt*n);printf(*tttt5 tttt*nnn);tnn

11、n);入住登记查询入住情况查询当前费用结账退房退岀程序printf(nn二二= 酒店房间登记与计费管理管理系统=tnnn); printf(请输入相应编号进入菜单t);接受输入 scanf(%d, &chooseNum);switch(chooseNum)case 1:GUI = HotelInfoUI; break;case 2:GUI = HotelInfoUI; break;case 3:GUI = OrderUI; break;case 4:GUI = OrderUI; break;case 5: Sleep(3000);GUI = Exit; break;default:break;

12、 void showHotelInfoUI()int chooseNum;sys te m(cls);printf(nn二= 店入住情况査询菜单 =tnnnn);printf(*ttt 入 住 房 间 数 : %dtttt*n, hotelInfo-checkinAmount);printf(*ttt 剩余房间数:t);printf( 单 人 房:%dtt*n,hotelInfo-singleRemainAmo unt);printf(*ttttt 双 人 房:%dtt*n,hotelInfo-doubleRemainAmo unt);printf(*ttttt 大 床 房:%dtt*nn,hotelInfo-bigRemainAmou nt);printf(nn= 店入住情况查询菜单 =tnnn);printf (“按 0 :返回 n); printf(按1:登记入住n);scanf(%d,&chooseNum);switch(chooseNum)case 0:GUI = MainUI;b

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 学术论文 > 其它学术论文

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