c語言课程设计宾馆管理信息系统.doc

  1. 1、本文档共12页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
c語言课程设计宾馆管理信息系统

数据结构体: 文件名:Structs.h 相应的实现: #includestdio.h #includestdlib.h #includestring.h #define FLOORNUMBER 5 #define ROOMNUMBER 10 //房间类型枚举型 typedef enum room_type{Single=1,Double=2,Luxury=3}RoomType; //房间信息结构体 typedef struct room_info { int Num; RoomType Roomtype; char Local[40]; int Rflag; float Price; char Tag[40]; }Room; //顾客信息结构体 typedef struct guest_info { char Name[20]; char ID[20]; char Sex; }Guest; //客房信息结构体 typedef struct guestandroom_info { int rNum; char gID[20]; char CheckinTime[30]; char CheckoutTime[30]; float debt; float discount; float pay; }GAR; extern int GuestNum; float Income; int datin; int datbook; int datroom1,datroom2,datroom3; char Ttype[3][10]={Single,Double,Luxury}; Room Rooms[FLOORNUMBER*ROOMNUMBER]; //房间信息数组 Guest Guests[FLOORNUMBER*ROOMNUMBER]; //客户信息数组 GAR GARs[FLOORNUMBER*ROOMNUMBER]; //客房信息数组 1.初始化模块:对房间信息数组、客户信息数组、客房信息数组进行初始化,即从文件中读取相关信息 。 文件名:Initialize.c 函数名void Initialize(); 相应的函数实现: #includeStructs.h void LoadRoomInfo() //房间信息初始化 { FILE *fp; if((fp=fopen(RoomInfo.txt,r))==NULL) { printf(Cant open the file of RoomInfo!\n); exit(0); } char temp[5][8]; fprintf(fp,%s%s%s%s%s,temp[0],temp[1],temp[2],temp[3],temp[4]); int iCount; for(;iCountFLOORNUMBER*ROOMNUMBER;iCount++) { fprintf(fp,%d%d%s%d%s,Rooms[iCount].Num,Rooms[iCount].Roomtype,Rooms[iCount].Local,Rooms[iCount].Rflag,Rooms[iCount].Tag)Tag; } printf(房间信息初始化成功.\n); } void LoadGuestInfo() //客户信息初始化 { FILE *fp; if((fp=fopen(GuestInfo.txt,r))==NULL) { printf(Cant open the file of GuestInfo!\n); exit(0); } char temp[3][8]; fprintf(fp,%s%s%s,temp[0],temp[1],temp[2]); int iCount; for(;iCountGuestNum;iCount++) { fprintf(fp,%s%s%c,Guests[iCount].Name,Guests[iCount].ID,Guests[iCount].Sex); } printf(客户信息初始化成功.\n); } //初始化客房信息 void LoadGARInfo() { FILE *fp; if((fp=fopen(GARInfo.txt,r))==NULL) { printf(Cant open the file of GARInfo!\n); exit(0); } char temp[7][8]; fprintf(fp,%s%s%s%s%s%s%s,temp[0],temp[1],temp[2],tem

文档评论(0)

sd47f8cI + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档