酒店管理系统代码(共12页).docx
《酒店管理系统代码(共12页).docx》由会员分享,可在线阅读,更多相关《酒店管理系统代码(共12页).docx(12页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、精选优质文档-倾情为你奉上#include #include #include#include#include/-结构定义-typedef struct CheckinInformationchar name10; /姓名int id; /证件号int roomType; /房型int countType; /计费方式CheckinInfo;typedef struct HotelRoomint roomType; /房型int roomNum; /房号int checked; /入住情况int price; /房价Room;typedef struct RoomOrderCheckinInf
2、o *checkinInfo; /入住信息long date; /入住时间Room * room; /房间信息Order;typedef struct HotelInfomationint checkinAmount; /已入住房数int singleRemainAmount; /单人房剩余房数int doubleRemainAmount; /双人房剩余房数int bigRemainAmount; /大床房剩余房数HotelInfo;/-枚举类型-enum MainUI,HotelInfoUI,CheckinUI,CheckinResultUI,OrderUI,CheckOutUI,Exit;
3、/GUIenum Single,Double,Big;/Room Typeenum Hour,Day;/countType/-全局变量-int GUI = MainUI;Order* orderList100;/订单数组Room* roomList100;/房间数组HotelInfo * hotelInfo = NULL;/酒店房间信息/-函数声明-void initiallizeRoomList();void insertToOrderList(Order * order);Room* getRoomByType(int roomType);Order* getOrderByRoomNum(
4、int roomNum);void showMainUI();void showHotelInfoUI();void showCheckinUI();void showCheckinResultUI();void showOrderUI();void showCheckOutUI();/-Main函数-void main() /主函数/初始化酒店房间信息hotelInfo = (HotelInfo *)malloc(sizeof(HotelInfo); hotelInfo - singleRemainAmount = 20;hotelInfo - doubleRemainAmount=40;h
5、otelInfo - bigRemainAmount=40;hotelInfo - checkinAmount=0;/初始化房间列表initiallizeRoomList();/界面显示while(GUI != Exit)switch(GUI)case MainUI:showMainUI();break;case HotelInfoUI:showHotelInfoUI();break;case CheckinUI:showCheckinUI();break;case CheckinResultUI:showCheckinResultUI();break;case OrderUI:showOrd
6、erUI();break;case CheckOutUI:showCheckOutUI();break;default: break;/-函数定义-void initiallizeRoomList()/房间数组初始化,初始化的结果是让roomList的数组有100个room指针,而且设置了相应的值int i;Room*newRoom=NULL;for(i=0;ichecked=0; roomListi-price=110; roomListi-roomNum=i+1; roomListi-roomType=Single;for(i=20;ichecked=0; roomListi-price=
7、180; roomListi-roomNum=i+1; roomListi-roomType=Double;for(i=60;ichecked=0; roomListi-price=180; roomListi-roomNum=i+1; roomListi-roomType=Big;/通过所选择的房型获取空房间,获取房间后将房间信息改为已入住,并减少相应房型的剩余房间数Room* getRoomByType(int roomType)int i;switch(roomType)case Single:for(i=0;ichecked = 0)roomListi-checked=1;hotelI
8、nfo-singleRemainAmount - ;hotelInfo-checkinAmount+;return roomListi;break;case Double:for(i=20;ichecked = 0)roomListi-checked=1;hotelInfo-doubleRemainAmount - ;hotelInfo-checkinAmount+;return roomListi;break;case Big:for(i=60;ichecked = 0)roomListi-checked=1;hotelInfo-bigRemainAmount -;hotelInfo-che
9、ckinAmount+;return roomListi;break;/将订单放入订单列表void insertToOrderList(Order * order)int i;for( i = 0;i100;i+)if( orderListi =NULL )orderListi = order;break;/通过房号查询订单Order* getOrderByRoomNum(int roomNum)int i;for(i=0;iroom-roomNum = roomNum)return orderListi;void showMainUI()/显示主界面,并接受输入int chooseNum;s
10、ystem(cls);printf(nn=酒店房间登记与计费管理管理系统=tnnn);printf(*tttt1. 入住登记 tttt*n);printf(*tttt2. 查询入住情况 ttt*n);printf(*tttt3. 查询当前费用 ttt*n);printf(*tttt4. 结账退房 tttt*n);printf(*tttt5. 退出程序 tttt*nnn);printf(nn=酒店房间登记与计费管理管理系统=tnnn);printf(请输入相应编号进入菜单t);/接受输入scanf(%d,&chooseNum);switch(chooseNum)case 1:GUI = Hote
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 酒店 管理 系统 代码 12
限制150内