酒店管理系统代码

  • 格式:docx
  • 大小:30.71 KB
  • 文档页数:24

下载文档原格式

  / 6
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

酒店管理系统代码

#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()

{