《酒店管理系统代码》由会员分享,可在线阅读,更多相关《酒店管理系统代码(6页珍藏版)》请在金锄头文库上搜索。
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 RoomOrderCheckinInfo *checkinInfo;
2、long date;Room * room;Order;typedef struct HotelInfomationint checkinAmount;int singleRemainAmount;int doubleRemainAmount;int bigRemainAmount;HotelInfo;/入住信息/入住时间房间信息/已入住房数单人房剩余房数/双人房剩余房数/大床房剩余房数枚举类型/ enumMainUI,HotelInfoUI,CheckinUI,CheckinResultUI,OrderUI,CheckOutUI,Exit;/GUIenum Single,Double,Big
3、;/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(int roomNum);void showMainU
4、I();void showHotelInfoUI();void showCheckinUI();void showCheckinResultUI();void showOrderUI();void showCheckOutUI();/Main 函数/主函数void main()/初始化酒店房间信息hotelInfo = (HotelInfo *)malloc(sizeof(HotelInfo);hotelInfo - singleRemainAmount = 20;hotelInfo - doubleRemainAmount=40;hotelInfo - bigRemainAmount=40;
5、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:showOrderUI();break;case CheckOutUI:showCheckOutUI();break;default:break;/函数定义 void initiallizeRoomList()