酒店房间登记与计费管理系统

上传人:油*** 文档编号:153517455 上传时间:2022-09-19 格式:DOC 页数:20 大小:133KB
收藏 版权申诉 举报 下载
酒店房间登记与计费管理系统_第1页
第1页 / 共20页
酒店房间登记与计费管理系统_第2页
第2页 / 共20页
酒店房间登记与计费管理系统_第3页
第3页 / 共20页
资源描述:

《酒店房间登记与计费管理系统》由会员分享,可在线阅读,更多相关《酒店房间登记与计费管理系统(20页珍藏版)》请在装配图网上搜索。

1、黑龙江工业学院C语言程序设计课题报告题目名称:酒店房间登记与计费管理系统班级:电气4班组长:王树锦组员:贾俊枫王莹许茗王冠指导教师:褚洪波一、程序功能描述1、屏幕上出现一个界面,让操作员能够方便的选择所需要进行的操作,包括登记入住、 查询房间的入住情况、查询当前费用、结账退房等操作。2、对不同标准的房间实施不同的收费标准, 也可以按天收费或按小时收费,可根据顾客 需要在登记入住时进行选择。3、在结账退房时,根据入住时间,计费方式和房间单价计算出总费用。前台操作:包括开房登记、退房结账和房状态查看预订管理:包括预订房间、预订入住和解除预订信息查询:包括在住客人列表、预订客人列表报表统计:包括开房

2、记录统计、退房结账和预订房间统计完成提示:(1)住店情况记录在住店管理表中:客人姓名、房号、入住时期、预计离开日期、结账 离开日期、应付金额(2)每个房间的使用情况记录在房间信息表中: 房号、价格、押金、房状态(空,入住)(3)预定情况记录在预订情况表中:客人姓名、房号、入住日期、预计离开日期二、程序流程图开始输入选择序号进入所选功能函数结束三、数据结构设计创建房间信息结构体/*创建结构体date,记录入住和结账时间*/struct dateint mon;int day;int hour;;/*创建结构体hotel*/struct hotelint num; / 房间号int kind; /

3、* 房间种类 1-单人间 2-双人间 */char name20; / 入住客户姓名char ID19; / 身份证号int h_money; / 按日收费价格int d_money; / 按小时收费价格struct date time; / 入住时间int flag; /*flag 含义 0-无人入住 1- 按小时入住 2-按天入住 */int deposit; / 押金roomM;四、总结及体会组长:王树锦实用为主系统以用户需求为目标,以方便用户为原则,同进融入先进的管理经验,在通 用的成熟的酒店管理系统的框架下,根据用户的实际需求功能情况,为用户进行二次开发, 度身订造一套先进的管理系统

4、,尽可能降低使用前的培训、实施和使用中的维护时间。充分 满足现在及未来的各种需求,真正为管理及决策提供强有力的支持。我认识到 c 语言实验是 非常注意书写的正确性和逻辑的严密性,实验过程本身就在考验一个人细心与耐心程度,还 有对所学知识的熟练程度。组员 1:贾俊枫先进灵活系统充分应用现有成熟的网络技术、软件开发技术,先进的客户/ 服务器结构,及高性能的 32 位大型网络数据库, 满足大型连锁客户的日常运营、 移动办公、 开展电子商务 等的需要。同时用户可自行灵活设置参数和各种代码,适应自己的特殊需要。这对我来说是 非常重要的方面。这次试验也让我知道在 c 语言中,条理清晰的流程是很重要的,它包

5、含你 编写程序的大致方向,是你在编程过程中不会走错路,也不会太盲目。组员 2:王莹稳定可靠通过选用先进的开发软件,成熟的网络结构及安全可靠的数据库,再配合硬件 的优化选型,从而保证系统的可靠性与容错性。宾馆信息管理系统主要实现宾馆酒店的客房 管理、客户信息管理、客户添加管理、客户修改管理、客户删除管理功能。在实验中,遇到 问题要想方设法将它解决,看书找资料,请教同学,与同学讨论,都是很好的途径。组员 3:许茗随着社会服务行业的发展,使用管理软件来管理整个宾馆企业的要求也逐年升温,有条 件的酒店或宾馆都采用了相关的酒店管理系统,以解决宾馆全凭原始的手工记录管理,效率 低、易出错的缺陷。宾馆行业对

6、自身提供服务的质量和能力也有了更高的要求,宾馆信息管 理系统正因此而越来越受到重视。组员 4:王冠一个宾馆信息管理系统应该包括基本的客房信息管理、客房客户信息管理、入住退房信 息管理等相关的信息管理。严谨认真的态度也不可或缺。实验中常常会遇到许多问题, c 语 言有自己解决问题的方法:找语法错误,找逻辑错误,调试等等,有时需要从整个程序方面 考虑,这就需要调试经验。五、程序源代码#include #include #include #include #include #include #include #include 100#define ROOM_MAX#define TYPE_NUM4#

7、define WIDTH80#define HIGH25typedef struct tm tm;typedef enum False, True Bool;typedef enum Single, Standard, Vip, President Type;typedef struct nodevoid *elem; struct node *next; node_t;/* 房间结构 */ typedef struct roomintroom_number;Boolroom_is_used;Typeroom_kind;charguest_name20;charguest_Id19;doubl

8、eroom_price;tm*start_time;tm*end_time;doubletotal_cost; room_t;void welcome();void menu();void locate_position();void animal();void animation(int x);void goodbye();node_t *list_init();node_t *list_add(node_t *head, void *elem);node_t *list_del(node_t *head, node_t *dest); node_t *list_for_each(node_

9、t *head,void *(*func)(node_t *head, node_t *cur, void *arg), void *arg);node_t *list_reverse(node_t *head);void list_destory(node_t *head);void 定位光标* x 要定位的列数* y 要定位的行数* 无返回值* 调用 API ,定位光标位置,比用空格, Tab , 回车定位方便许多 */void locate_position(int x, int y)COORD C;mprint(node_t *head, node_t *cur, void *arg)

10、;void *madd(node_t *head, node_t *cur, void *arg);void *mdel(node_t *head, node_t *cur, void *arg);void room_add(node_t *head, room_t hotalTYPE_NUMROOM_MAX);void room_del(node_t *head);void price_info();int increase_two(int i);double price_of_room(Type kind);char *Type_to_string(Type kind);char *Boo

11、l_to_string(Bool _bool_);room_t *get_first_room(room_t hotalROOM_MAX, Type kind);* increase_two* i 要自增的数* 调用一次增加 2*/int increase_two(int i)return i+2;* price_of_room* kind 房间类型* 根据房间的类型得到房间的单价*/double price_of_room(Type kind)return pow(2, (int)kind) * 100;C.X = x;C.Y = y;SetConsoleCursorPosition(Get

12、StdHandle(STD_OUTPUT_HANDLE), C); * welcome* 显示欢迎界面 (总菜单界面的大部分内容)* 列出用户可进行的操作* 每次任务完成后,再次调用些界面 */void welcome()int position = 4;locate_position(25, 3);printf( 酒店房间登记与计费管理系统 );locate_position(30, position = increase_two(position); printf(1: 登记入住 );locate_position(30, position = increase_two(position)

13、; printf(2: 查询房间入住 );locate_position(30, position = increase_two(position); printf(3: 查询当前费用 );locate_position(30, position = increase_two(position); printf(4: 结账退房 );locate_position(30, position = increase_two(position); printf(5: 帮助说明 );locate_position(30, position = increase_two(position); printf

14、(6: 关于 );locate_position(30, position = increase_two(position); printf(0: 退出 );locate_position(27, position = increase_two(position); printf( 请选择要办理的业务 n);void goodbye()char is_leave = i; char str15 = color 0; char str_color2;int color; time_t tTime;tm *tBlock;locate_position(33, 10);printf( 确认退出 (Y

15、/N) ? );while (is_leave != Y & is_leave != N)is_leave = kbhit() ? toupper(getch() : m;animal(1); animation(6); animal(18); animation(19); animal(20);animation(21);animal(22); animation(23);strcpy(str, color 0); color = rand() % 8 + 8; itoa(color,str_color, 16); strcat(str, str_color); system(str);lo

16、cate_position(29,4);tTime = time(NULL); tBlock = localtime(&tTime);printf(%s %2d:%02d:%02d, _DATE_, tBlock-tm_hour, tBlock-tm_min, tBlock-tm_sec);locate_position(33, 10); printf( 确认退出 (Y/N)?);_sleep(1000); if (toupper(is_leave) = Y) locate_position(30, 13);printf( 谢谢使用,欢迎下次来访 !); locate_position(0,0

17、);getch(); exit(0);elsesystem(cls); menu();* price_info* 无参数,显示房间的价格*/void price_info()int position = 1;int weidth = 20;printf(n 房间的收费如下- );locate_position(weidth, position = increase_two(position);printf(1: %-20s 单 间 %10.2f, Type_to_string(Type)0), price_of_room(Type)0); locate_position(weidth, pos

18、ition = increase_two(position);printf(2: %-20s标 准 间%10.2f, Type_to_string(Type)1), price_of_room(Type)1); locate_position(weidth, position = increase_two(position);printf(3: %-20s VIP 房 间%10.2f, Type_to_string(Type)2), price_of_room(Type)2); locate_position(weidth, position = increase_two(position);

19、printf(4: %-20s总 统 套 房%10.2f, Type_to_string(Type)3), price_of_room(Type)3);locate_position(weidth + 6, position = increase_two(position);printf( 从中午十二点到第二天中午十二点算一天 n);locate_position(weidth + 12, position = increase_two(position);printf( 不足一天按一天算 );_sleep(3000);* animation* 展示一个小动画* x 在第几行展示* 其中随着时

20、间流逝, 不断的向右移动 */void animation(int x)static int i = 1;locate_position(1, x); printf(=);locate_position(i % (WIDTH-5), x); printf();i += 3;if (i WIDTH - 5)i = 1;/* 根据不同的选项,进入不同的子模块 */void menu()int color;int i = 0, j;char str15;char str_color2;char ch = m; time_t tTime; tm *tBlock;和上面的函数相似,这次是向左*/ voi

21、d animal(int x)static int i = 74;locate_position(1, x); printf( );locate_position(i % (WIDTH-5), x); printf();i -= 5;if (i 0)i = WIDTH - 6;room_t hotalTYPE_NUMROOM_MAX; node_t *head = list_init();memset(&hotal, 0, sizeof(room_t) * TYPE_NUM * ROOM_MAX);/* 初始化房间信息 */ for (i = 0; i TYPE_NUM; i+)for (j

22、= 0; j tm_hour, tBlock-tm_min, tBlock-tm_sec);locate_position(48, 20);_sleep(1000);* list_init* 初始化链表,这个链表为循环链表, 有头结点 */node_t list_del* 删除列表中的元素* head 列表的头结点* dest 要删除的结点* 给出要删除的结点,从头结点开始找到要删除的结点,然后删除* 表头元素不能删除list_init()node_t *head = (node_t *)malloc(sizeof(node_t);head-elem = NULL; head-next = h

23、ead;return head; */list_add 向链表里面添加结点head 链表的头结点elem 结点中的数据 此列表为尾插法node_t *list_add(node_t *head, void *elem)node_t *new_node = (node_t *)malloc(sizeof(node_t);new_node-elem = elem; new_node-next = head-next; head-next = new_node;return new_node;*/node_t *list_del(node_t *head, node_t *dest)node_t *

24、pre = head;node_t *cur = pre-next;while (cur != dest)if (cur != head)pre = pre-next;cur = cur-next;elsereturn head;pre-next = cur-next;/* 释放指针后直接赋值为 NULL, 预防 野指针* free(cur);*cur = NULL;* 但是这个地方不能 free 了,因为它的元素包含有房间数组* 而房间还是要用的。所以就不能消了。*/return pre-next;* list_for_each* 遍历链表* head 链表头结点* func 函数指针,对不

25、同的遍历进行不同的操作* arg 参数, 有时候可以不用,主要是为了向 func 所指向的函数传递参数 */node_t *list_for_each(node_t *head,void *(*func)(node_t *head, node_t *cur, void *arg), void *arg) node_t *cur = head-next;while (cur != head) func(head, cur, arg); cur = cur-next;return head;/* list_reverse* 反转链表* head 要转的链表的表头结点* 链表调换过来,原来的表头现在

26、为表尾,不过对于循环链表来说这个操作很简单 */node_t *list_reverse(node_t *head)node_t *pre = head; node_t *cur = pre-next; node_t *nxt = cur-next;while (cur != head)cur-next = pre; pre = cur;cur = nxt;nxt = nxt-next; cur-next = pre;return head; * list_destory* 销毁链表* head 要销毁链表的表头结点* 程序退出前可以把链表销毁*/void list_destory(node_

27、t *head)node_t *cur = head-next;while (cur != head) head-next = cur-next;free(cur); cur = cur-next;free(head);* mprint* 打印结点的内容调用* head 链表的头结点 本函数不用,为了给 list_for_each* cur 要打印的当前结点* arg 占位*/ void *mprint(node_t *head, node_t *cur, void *arg)prin tf(%dt%-15s%-10s%-20stt%4.2f(元 / 天)n,(room_t *)(cur-el

28、em)-room_number,Type_to_string(room_t *)(cur-elem)-room_kind),(room_t *)(cur-elem)-guest_name,(room_t *)(cur-elem)-guest_Id,(room_t *)(cur-elem)-room_price);return NULL;* mdel* 删除给定 元素内容 的结点* head 链表的头结点* cur要删除的结点* arg要删除结点中的一项内容* 通过 arg, 找到要删除的结点,再调用 list_del 删除结点 */void *mdel(node_t *head, node_t

29、 *cur, void *arg)if (room_t *)(cur-elem)-room_number = *(int *)arg) list_del(head, cur);return NULL; /*Bool_to_string* _bool_将给定的E ool类型变量返回S tring值用于输出 */char *Bool_to_string(Bool _bool_)return False; return True;return NULL;switch (_bool_)case False:case True: default:/*Type_to_string*/kind将给定的Typ

30、e类型变量返回S tring值用于输出char *Type_to_string(Type kind)switch (kind)case Single: case Standard: case Vip:case President: default:return Single;return Standard return Vip;return President return NULL;* get_first_room* 得到第一个为空的房间* hotal 房间数组* kind 哪一种类型的房间 */room_t *get_first_room(room_t hotalROOM_MAX, Typ

31、e kind) int i;for (i = 0; i room_is_used)return hotal; return NULL;* room_add* 将要住处的房间添加到房间链表里面。* hoad 链表头* hotal 整个酒店的房间* 首先由房客确定要居住的房间类型* 根据类型,调用 get_first_room 得到第一个没有居住的房间* 再把房间信息填完整,最后加入到房间链表里面。*/void room_add(node_t *head, room_t hotalTYPE_NUMROOM_MAX) int position = 1;Type kind; time_t timer

32、= time(NULL); room_t *room_dest;locate_position(30, position = increase_two(position); printf( 一共有四种类型的房间 nn);locate_position(25, position = increase_two(position); printf(1: Single 单 间 );locate_position(25, position = increase_two(position); printf(2: Standard标准 间 );locate_position(25, position = i

33、ncrease_two(position); prin tf(3: Vip VIP 房 间);locate_position(25, position = increase_two(position); printf(4: President总 统 套 房);locate_position(25, position = increase_two(position);prin tf(0: Esc取消n);locate_position(25, position = increase_two(position);printf( 请选择要居住的类型,按 0 取消本次操作 :n);locate_pos

34、ition(30, position = increase_two(position); scanf(%d, &kind);/* 用户选择取消,则直接退出 */if (!kind)return;/* 因为输入的类型比房间类型大 1 所以要减 1 */ room_dest = get_first_room(hotalkind-1, kind-1); room_dest-room_is_used = True;locate_position(33, position = increase_two(position); printf( 请输入您的姓名 ?);locate_position(35, p

35、osition = increase_two(position); scanf(%s, room_dest-guest_name);do locate_position(30, position = increase_two(position); printf( 请输入您的 18 位身份证号 ?);locate_position(30, position = increase_two(position); scanf(%s, room_dest-guest_Id); while (strlen(room_dest-guest_Id) != 18);/* 入住时间和离开时间都为当时时间,离开时间

36、在每次查看的时候都会增加的。 */ room_dest-start_time = localtime(&timer); room_dest-start_time = localtime(&timer);list_add(head, room_dest); locate_position(25, position = increase_two(position); printf( 入住信息已经填写完整,祝您居住愉快 !); locate_position(30, position = increase_two(position);* room_del* 删除房间* head 链表头结点* 删除房

37、间函数,根据要房客要退房的房间号,调用 mdel 从链表中去除房间信息。 */void room_del(node_t *head)int del_num;char ch = i;printf( 请输入要退定的房间号 n); scanf(%d, &del_num);printf( 要删除的房间号是 :%dn, del_num);while (toupper(ch) != Y & toupper(ch) != N) printf( 确定退房 (Y/N)n); ch = getchar();if (toupper(ch) = Y)list_for_each(head, mdel, (void *)&del_num); printf( 退记成功,欢迎下次光临 !n);int main()menu();return 0;* menu* 菜单项* 没有参数,显示菜单界面

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

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!