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

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

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

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

2、、退房结账和预订房间统计完成提示:1住店情况记录在住店管理表中:客人*、房号、入住时期、预计离开日期、结账离开日期、应付金额(2) 每个房间的使用情况记录在房间信息表中:房号、价格、押金、房状态空,入住 3预定情况记录在预订情况表中:客人*、房号、入住日期、预计离开日期 二、程序流程图开场输入选择序号号进入所选功能函数完毕三、数据构造设计创立房间信息构造体 /*创立构造体date,记录入住和结账时间*/ struct date int mon; int day; int hour; ;/*创立构造体hotel*/struct hotel int 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 *define ROOM_MA* 100*define TYPE_NUM 4*define WIDTH 80*define HIGH 25typedef struct tm tm;t

7、ypedef enum False, True Bool;typedef enum Single, Standard, Vip, President Type;typedef struct node void *elem; struct node *ne*t; node_t;/* 房间构造 */typedef struct room int room_number; Bool room_is_used; Type room_kind; char guest_name20; char guest_Id19; double room_price; tm *start_time; tm *end_t

8、ime; double total_cost; room_t;void wele();void menu();void locate_position();void animal();void animation(int *);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_t *head, void *(*func)(node_t *head,

9、 node_t *cur, void *arg), void *arg);node_t *list_reverse(node_t *head);void list_destory(node_t *head);void *mprint(node_t *head, node_t *cur, void *arg);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_NU

10、MROOM_MA*);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 *Bool_to_string(Bool _bool_);room_t *get_first_room(room_t hotalROOM_MA*, Type kind);/* * increase_two * * i 要自增的数 * 调用一次增加 2 */int increase_two(int i

11、) return i+2;/* * price_of_room * * kind 房间类型 * 根据房间的类型得到房间的单价 */double price_of_room(Type kind) return pow(2, (int)kind) * 100;/* * 定位光标 * * 要定位的列数 * y 要定位的行数 * 无返回值 * * 调用API,定位光标位置,比用空格,Tab, 回车定位便多 */void locate_position(int *, int y) COORD C; C.* = *; C.Y = y; SetConsoleCursorPosition(GetStdHand

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

13、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(6: 关于);

14、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/N).); w

15、hile (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); locat

16、e_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); g

17、etch(); e*it(0); else system(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(wei

18、dth, position = 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房 间%10.2f, Type_to_string(Type)2), price_of_room(Type)2); locate_position(weidth, position = increase_two(posit

19、ion); 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 * 展示一个小动画 * 在第几

20、行展示 *其中随着时间流逝, 不断的向右移动 */void animation(int *) static int i = 1; locate_position(1, *); printf( =); locate_position(i % (WIDTH-5), *); printf(); i += 3; if (i WIDTH - 5) i = 1; /* * 和上面的函数相似,这次是向左*/void animal(int *) static int i = 74; locate_position(1, *); printf( -); locate_position(i % (WIDTH-5)

21、, *); printf(); i -= 5; if (i 0) i = WIDTH - 6; /* * menu * 菜单项 * * 没有参数,显示菜单界面 * 根据不同的选项,进入不同的子模块 */void menu() int color; int i = 0, j; char str15; char str_color2; char ch = m; time_t tTime; tm *tBlock; room_t hotalTYPE_NUMROOM_MA*; node_t *head = list_init(); memset(&hotal, 0, sizeof(room_t) * T

22、YPE_NUM * ROOM_MA*); /* 初始化房间信息 */ for (i = 0; i TYPE_NUM; i+) for (j = 0; j tm_hour, tBlock-tm_min, tBlock-tm_sec); locate_position(48, 20); _sleep(1000); /* * list_init * 初始化链表,这个链表为循环链表, 有头结点 */node_t *list_init() node_t *head = (node_t *)malloc(sizeof(node_t); head-elem = NULL; head-ne*t = head;

23、 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-ne*t = head-ne*t; head-ne*t = new_node; return new_node;/* * list_del * 删除列表中的元素 * * head 列表的

24、头结点 * dest 要删除的结点 * 给出要删除的结点,从头结点开场找到要删除的结点,然后删除 * 表头元素不能删除 */node_t *list_del(node_t *head, node_t *dest) node_t *pre = head; node_t *cur = pre-ne*t; while (cur != dest) if (cur != head) pre = pre-ne*t; cur = cur-ne*t; else return head; pre-ne*t = cur-ne*t;/* 释放指针后直接赋值为 NULL, 预防 野指针 * free(cur); *

25、cur = NULL; * 但是这个地不能free了,因为它的元素包含有房间数组 *而房间还是要用的。所以就不能消了。 */ return pre-ne*t;/* * list_for_each * 遍历链表 * * head 链表头结点 * func 函数指针,对不同的遍历进展不同的操作 * 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 =

26、 head-ne*t; while (cur != head) func(head, cur, arg); cur = cur-ne*t; return head;/* * list_reverse * 反转链表 * *head 要转的链表的表头结点 *链表调换过来,原来的表头现在为表尾,不过对于循环链表来说这个操作很简单 */node_t *list_reverse(node_t *head) node_t *pre = head; node_t *cur = pre-ne*t; node_t *n*t = cur-ne*t; while (cur != head) cur-ne*t = p

27、re; pre = cur; cur = n*t; n*t = n*t-ne*t; cur-ne*t = pre; return head;/* * list_destory * 销毁链表 * *head 要销毁链表的表头结点 *程序退出前可以把链表销毁 */void list_destory(node_t *head) node_t *cur = head-ne*t; while (cur != head) head-ne*t = cur-ne*t; free(cur); cur = cur-ne*t; free(head);/* * mprint * 打印结点的容 * *head 链表的头

28、结点本函数不用,为了给list_for_each 调用 *cur 要打印的当前结点 *arg 占位 */void *mprint(node_t *head, node_t *cur, void *arg) printf(%dt%-15s%-10s%-20stt%4.2f(元/天)n, (room_t *)(cur-elem)-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 *)(c

29、ur-elem)-room_price); return NULL;/* * mdel * 删除给定 元素容 的结点 * * head 链表的头结点 * cur 要删除的结点 * arg 要删除结点中的一项容 * 通过arg, 找到要删除的结点,再调用list_del删除结点 */void *mdel(node_t *head, node_t *cur, void *arg) if (room_t *)(cur-elem)-room_number = *(int *)arg) list_del(head, cur); return NULL;/* * Bool_to_string * * _b

30、ool_ 将给定的ool类型变量返回tring值用于输出 */char *Bool_to_string(Bool _bool_) switch (_bool_) case False: return False; case True: return True; default: return NULL; /* * Type_to_string * * kind 将给定的ype类型变量返回tring值用于输出 */char *Type_to_string(Type kind) switch (kind) case Single: return Single; case Standard: ret

31、urn Standard; case Vip: return Vip; case President: return President; default: return NULL; /* * get_first_room * 得到第一个为空的房间 * *hotal 房间数组 *kind 哪一种类型的房间 */room_t *get_first_room(room_t hotalROOM_MA*, Type kind) int i; for (i = 0; i room_is_used) return hotal; return NULL;/* * room_add * 将要住处的房间添加到房

32、间链表里面。 * *hoad 链表头 *hotal 整个酒店的房间 * * 首先由房客确定要居住的房间类型 *根据类型,调用get_first_room得到第一个没有居住的房间 *再把房间信息填完整,最后参加到房间链表里面。 */void room_add(node_t *head, room_t hotalTYPE_NUMROOM_MA*) int position = 1; Type kind; time_t timer = time(NULL); room_t *room_dest; locate_position(30, position = increase_two(position

33、); 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 = increase_two(position); printf(3: Vip 房 间); locate_position(25, position = increase_

34、two(position); printf(4: President 总 统 套 房); locate_position(25, position = increase_two(position); printf(0: Esc 取消n); locate_position(25, position = increase_two(position); printf(请选择要居住的类型,按0取消本次操作:n); locate_position(30, position = increase_two(position); scanf(%d, &kind); /* 用户选择取消,则直接退出*/ if (

35、!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, position = increase_two(position); scanf(%s, room_dest-guest_name); do locate_positio

36、n(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); /* 入住时间和离开时间都为当时时间,离开时间在每次查看的时候都会增加的。*/ room_dest-start_time = localtime(&timer); room_dest-start_time = local

37、time(&timer); list_add(head, room_dest); locate_position(25, position = increase_two(position); printf(入住信息已经填写完整,祝您居住愉快!); locate_position(30, position = increase_two(position);/* * room_del * 删除房间 * *head 链表头结点 *删除房间函数,根据要房客要退房的房间号,调用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; . z.

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