酒店管理系统代码
- 格式:docx
- 大小:30.71 KB
- 文档页数:24
酒店管理系统代码
#include
#include
#include
#include
#include
//--------------------------------------------------结构定义------------------------------------------
typedef struct CheckinInformation
{
char name[10]; //姓名
int id; //证件号
int roomType; //房型
int countType; //计费方式
}CheckinInfo;
typedef struct HotelRoom
{
int roomType; //房型
int roomNum; //房号
int checked; //入住情况
int price; //房价
}Room;
typedef struct RoomOrder
{
CheckinInfo *checkinInfo; //入住信息
long date; //入住时间
Room * room; //房间信息
}Order;
typedef struct HotelInfomation
{
int checkinAmount; //已入住房数
int singleRemainAmount; //单人房剩余房数
int doubleRemainAmount; //双人房剩余房数
int bigRemainAmount; //大床房剩余房数
}HotelInfo;
//--------------------------------枚举类型---------------------------
enum
{MainUI,HotelInfoUI,CheckinUI,CheckinResultUI,OrderUI,Che ckOutUI,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* getOrderByRoomNum(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;
hotelInfo -> 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:
showOrderUI();
break;
case CheckOutUI:
showCheckOutUI();
break;
default:
break;
}
}
}
//-------------------------------函数定义----------------------------
void initiallizeRoomList()
{