c语言课程设计-酒店管理系统.docxVIP

  • 8
  • 0
  • 约1.79万字
  • 约 19页
  • 2023-08-14 发布于浙江
  • 举报
#includestdio.h #includestring.h #includemalloc.h #includestdlib.h #includeconio.h #define LEN sizeof(struct customer) /*结构体定义*/ struct room { char num[10]; int price; }; struct customer { char name[20]; char id[18]; char d1[11]; char d2[11]; struct room r; int days; int money; struct customer *next; }; /*函数声明*/ void loadrec(); /*从磁盘文件导入入住信息到内存*/ void creatrec(); /*新建客户入住信息记录*/ void searchroom(); /*查询已入住的房间*/ void writeinfo(); /*保存客户入住信息*/ void searchrec(); /*查询房间入住信息记录*/ int countday(char s1[],char s2[]); /*计算入住天数*/ int account(char s1[],char s2[],int e); /*计算住宿费用*/ int checkdate(char s[]); /*判断日期是否合法*/ void stasticmoney(); /*统计某段时间内房间产生的住宿费*/ void exit0(); /*退出*/ void look(); /*查看此系统的功能*/ int menuslect(); /*菜单*/ int change1(char s[]); /*将字符格式的年份转换成数值格式的年份*/ int change2(char s[]); /*将字符格式的月份转换成数值格式的月份*/ int change3(char s[]); /*将字符格式的日转换成数值格式的日*/ int checkname(char *a); /*判断名字是否合法*/ /*链表操作所用结构体指针*/ struct customer *head=NULL,*p1,*p2,*p3; /*定义结构体指针,hend为头指针,p1为输入数据缓存空间指针,p2为尾指针*/ /*客户入住信息记录保存标志全局变量*/ int writeinfo_flag=0; /*主函数*/ int main() { printf(\n\t\t 酒 店 登 记 与 计 费 管 理 课 程 设 计\n); printf(\n\n\n\t\t\t 作者:李义鑫\n); printf(\n\t\t\t 班级:T1123-8\n); printf(\n\t\t\t 联系方式n); printf(\n\n\n\t\t\t 按回车键进入); rewind(stdin); getchar(); system(cls); printf(\n\t***************欢迎使用酒店登记与计费管理系统****************\n); printf(\n\n\t\t\t 按回车键进入); rewind(stdin); getchar(); system(cls); loadrec(); for(;;) { system(cls); switch(menuslect()) { case 1: system(cls); searchroom(); break; case 2: system(cls); creatrec();

文档评论(0)

1亿VIP精品文档

相关文档