C语言程序设计酒店管理系统实验报告韩国齐_第1页
C语言程序设计酒店管理系统实验报告韩国齐_第2页
C语言程序设计酒店管理系统实验报告韩国齐_第3页
C语言程序设计酒店管理系统实验报告韩国齐_第4页
C语言程序设计酒店管理系统实验报告韩国齐_第5页
已阅读5页,还剩13页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

课程设计报告书 题 目:酒店管理系统设计报告 专 业: 电子信息工程(移动互联网) 班 级: 一班 姓 名: 韩国齐 学 号: 0 教 师: 朴海光 一:程序功能酒店系统管理包括:主菜单、查看客房入住情况、登记入住、修改客房信息、修改客房信息及退房六个功能模块。每个功能用一个函数来实现,从而达到功能的模块化。主菜单模块:主菜单模块包括1.查看客房入住情况、2.登记入住、3.客房信息修改、4. 退房及显示入住的总费用、5.返回主菜单、6.直接退出程序。 1)查看客房入住情况功能模块:主要功能是查看房间的入住情况和继续查看已入住的房间的客户信息。2)登记入住功能模块:采用结构体数组来记录客户的信息,包括姓名、性别、年龄、身份证号、入住时间,入住单价及入住人数,登记完一个房间后可选择继续下一个房间的登记,也可以选择返回主菜单进行其他功能的操作。3)修改客房信息功能模块:包括修改客户信息模块和修改房间信息模块。4)修改客户信息模块:主要功能是可选择性的修改客户某个信息,也可以一次性全部修改。5)修改客房信息功能模块:用来对客户换房时对客户信息和房间号的修改。实现的功能是只要输入客户以前住的房间号和现在想住的房间号, 就将客户的信息全部移到现在想住的房间上,而以前的房间将被置为未使用。6)退房及显示总费用功能模块:当客户退房时,将客户使用的客房置为未使用,删除客户信息。并且显示客户从入住到退房时的总费用。 二:程序代码#include#include#include#define M 80int j,s;int hj81=0;FILE *fp; /定义文件指针变量struct date /定义结构体类型int month;int day;int year;final;struct clientchar name20;int sex;int age;char ID_card20;int count;struct date start;struct hotelint price;int room_ID;struct client personal;roomM;void save(); /声明文件函数void check_siru(); /声明查看客房入住情况函数void registration_live(); /声明登记入住信息函数void modify_infor(); /声明修改客房信息函数void amend_one(); /声明修改个人信息函数void amend_room(); /声明修改房间信息函数void cost(); /声明退房及显示入住费用函数void get_back(); /声明返回主菜单函数void check_siru1(); /声明查看客房入住情况的调用函数void registration_live1(); /声明登记入住信息的调用函数void amend_one1(); /声明修改个人信息的调用函数void amend_room1(); /声明修改房间信息的调用函数void cost1(); /声明显示入住费用的调用函数 int main() /主函数int menu();void print_message();printf(nnnnn);print_message();menu();save();return 0;void print_message()printf(ttt 欢迎入住黄金酒店nnn);menu() /主菜单函数int n;printf(n);printf(ttt 主菜单 nn);printf(ttt 按 1 查看客房入住情况n);printf(ttt 按 2 登记入住信息n);printf(ttt 按 3 修改客房信息n);printf(ttt 按 4 退房、及显示入住费用n);printf(ttt 按 5 返回主菜单n);printf(ttt 按 6 退出程序n);printf(nt请输入要进行操作的选项(1、2、3、4、5、6): );scanf(%d,&n);while(n6)printf(ttt 输入错误,请重新输入选项!);scanf(%d,&n);switch(n)case 1:check_siru();break;case 2:registration_live();break;case 3:modify_infor();break;case 4:cost();break;case 5:get_back();break;case 6:exit(0);return 0;void check_siru() /查看房间使用情况函数int a,g,count=0;for(g=1;g=80;g+)if(hjg=0)+count;elseif(hjg=1)printf(nttt正在使用的房间号:%d,g);printf(nnttt未使用的房间数:%d,count);printf(nnttt按 1 返回主菜单,按 2 继续: );scanf(%d,&a);switch(a) case 1:menu();break; case 2: printf(nn); printf(nttt请输入要查询的房间号: ); scanf(%d,&s); if(hjs=1) printf(nttt 姓名:%s,); printf(nttt性别(其中:1表示男,2表示女!):%d,rooms.personal.sex); printf(nttt 年龄:%d,rooms.personal.age); printf(nttt身份证号:%s,rooms.personal.ID_card); printf(nttt入住年份:%d,rooms.personal.start.year); printf(nttt 月:%d,rooms.personal.start.month); printf(nttt 日:%d,rooms.personal.start.day); printf(nttt 房间号:%d,rooms.room_ID); printf(nttt客房单价:%d,rooms.price); printf(nttt入住人数:%d,rooms.personal.count); printf(nnttt按 1 返回主菜单,按 2 继续n); scanf(%d,&a); switch(a) case 1:menu();break; case 2:check_siru1();break; elseprintf(nttt该房间未被使用!);save();printf(nnttt按 1 返回主菜单,按 2 继续: );scanf(%d,&a);switch(a) case 1:menu();break; case 2:check_siru1();break;void registration_live() /登记入住函数int a;printf(tt请输入登记的相关信息:n);printf(nttt房间号);scanf(%d,&j);roomj.room_ID=j;printf(nttt 姓名:);scanf(%s,);printf(nt性别(其中:1表示男,2表示女!):);scanf(%d,&roomj.personal.sex);printf(nttt 年龄:);scanf(%d,&roomj.personal.age);printf(nttt身份证号:);scanf(%s,roomj.personal.ID_card);printf(nttt入住年份:);scanf(%d,&roomj.personal.start.year);printf(nttt 月份:);scanf(%d,&roomj.personal.start.month);printf(nttt 日期:);scanf(%d,&roomj.personal.start.day);printf(nttt客房单价:);scanf(%d,&roomj.price);printf(ntt 请输入入住人数: );scanf(%d,&roomj.personal.count);hjj=1;save();printf(nntt按 1 返回主菜单,按 2 继续: );scanf(%d,&a);switch(a) case 1:menu();break; case 2:registration_live1();break;void modify_infor() /修改客房函数int r,m;printf(ttt 菜单 nnn);printf(ttt1:修改客户信息n);printf(ttt2:修改房间信息n);printf(ttt3:返回主菜单n);printf(ttt4:退出程序n);printf(nntt 请选择输入选项(1、2、3、4): );scanf(%d,&m);if(m3)r=1;else r=0;switch(m)case 1:amend_one1();break;case 2:amend_room1();break;case 3:menu();case 4:exit(0);save();void amend_one() /修改客人信息函数int i,q;char a20;printf(nnttt请输入现住的房间号: );scanf(%d,&j);printf(nttt请选择您要修改的个人选项n);printf(ttt1:代表姓名 nttt2:代表性别(其中1表示男,2表示女) nttt3:年龄 nttt4:代表身份证号 nttt5:代表入住年份 nttt6:代表入住月份 nttt7:代表入住日期 nttt8:入住人数n);printf(ttt请选择输入选项(1、2、3、4、5、6、7、8): );scanf(%d,&q);switch(q)int t,p;case 1:printf(nttt请输入新名字: );scanf(%s,a);strcpy(,a);printf(nnttt按 1 返回主菜单,按 2 继续: );scanf(%d,&i);switch(i) case 1:menu();break; case 2:amend_one1();break;case 2:printf(ntt请输入新性别(其中:1表示男,2表示女): );scanf(%d,&p);roomj.personal.sex=p;printf(nnttt按 1 返回主菜单,按 2 继续: );scanf(%d,&i);switch(i) case 1:menu();break; case 2:amend_one1();break;case 3:printf(nttt请输入年龄: );scanf(%d,&p);roomj.personal.age=p;printf(nnttt按 1 返回主菜单,按 2 继续: );scanf(%d,&i);switch(i) case 1:menu();break; case 2:amend_one1();break;case 4:printf(nttt请输入新身份证号: );scanf(%s,roomj.personal.ID_card);printf(nnttt按 1 返回主菜单,按 2 继续: );scanf(%d,&i);switch(i) case 1:menu();break; case 2:amend_one1();break;case 5:printf(nttt请输入新年份: );scanf(%d,&p);roomj.personal.start.year=p;printf(nnttt按 1 返回主菜单,按 2 继续: );scanf(%d,&i);switch(i)case 1:menu();break;case 2:amend_one1();break;case 6:printf(nttt请输入新月份: );scanf(%d,&p);roomj.personal.start.month=p;printf(nnttt按 1 返回主菜单,按 2 继续: );scanf(%d,&i);switch(i)case 1:menu();break;case 2:amend_one1();break;case 7:printf(nttt请输入新日期: );scanf(%d,&p);roomj.personal.start.day=p;printf(nnttt按 1 返回主菜单,按 2 继续: );scanf(%d,&i);switch(i)case 1:menu();break;case 2:amend_one1();break;case 8:printf(nttt请输入新入住人数: );scanf(%d,&p);roomj.personal.count=p;printf(nnttt按 1 返回主菜单,按 2 继续: );scanf(%d,&i);switch(i)case 1:menu();break;case 2:amend_one1();break;menu();void amend_room() /修改房间信息函数int a,l,x;printf(ntttt请输入你要修改的 客房信息nn);printf(tttt1:房间号nntttt2:客房单价nntttt3:入住人数nntttt4:返回nn);printf(ttt请选择输入选项(1、2、3、4): );scanf(%d,&l);switch(l)case 1:printf(nttt请输入旧房号: );scanf(%d,&j);printf(ttt请输入新房号: );scanf(%d,&s);strcpy(,);/=0;rooms.personal.sex=roomj.personal.sex;roomj.personal.sex=0;rooms.personal.age=roomj.personal.age;roomj.personal.age=0;strcpy(rooms.personal.ID_card,roomj.personal.ID_card); /roomj.personal.ID_card=0;rooms.personal.start.year=roomj.personal.start.year;roomj.personal.start.year=0;rooms.personal.start.month=roomj.personal.start.month;roomj.personal.start.month=0;rooms.personal.start.day=roomj.personal.start.day;roomj.personal.start.day=0;rooms.room_ID=s;rooms.price=roomj.price;rooms.personal.count=roomj.personal.count;hjs=1;hjj=0;printf(nntt按 1 返回主菜单,按 2 继续: );scanf(%d,&a);switch(a)case 1:menu();break;case 2:amend_room1();break;case 2:printf(nttt 请输入房号: );scanf(%d,&s);printf(ttt请输入新单价: );scanf(%d,&x);rooms.price=x;printf(nntt按 1 返回主菜单,按 2 继续: );scanf(%d,&a);switch(a)case 1:menu();break;case 2:amend_room1();break;case 3:printf(nttt 请输入房号: );scanf(%d,&s);printf(ttt请输入新入住人数: );scanf(%d,&x);rooms.personal.count=x;printf(nntt按 1 返回主菜单,按 2 继续: );scanf(%d,&a);switch(a)case 1:menu();break;case 2:amend_room1();break;case 4:break;save();menu();void cost() /退房、显示入住费用函数int a,i,sum;printf(ttt请输入房间号: );scanf(%d,&j);roomj.room_ID=j;printf(nttt 入住年份:%d,roomj.personal.start.year);printf(nttt 月:%d,roomj.personal.start.month);printf(nttt 日:%d,roomj.personal.start.day);printf(nttt 房间单价为: );printf(%d,roomj.price);printf(nttt请输入退房时间: );printf(nttt 请输入年份: );scanf(%d,&final.year);printf(nttt 请输入月份: );scanf(%d,&final.month);printf(nttt 请输入日期: );scanf(%d,&final.day);printf(nttt请输入入住天数: );scanf(%d,&i);sum=roomj.price*i;printf(nttt 总费用sum=%dn,sum);hjj=0;save();printf(nntt按 1 返回主菜单,按 2 继续: );scanf(%d,&a);switch(a) case 1:menu();break; case 2:cost1();break;void get_back()

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论