酒店房间登记与计费管理系统方案.docx

上传人:b****6 文档编号:6591189 上传时间:2023-01-08 格式:DOCX 页数:25 大小:40.79KB
下载 相关 举报
酒店房间登记与计费管理系统方案.docx_第1页
第1页 / 共25页
酒店房间登记与计费管理系统方案.docx_第2页
第2页 / 共25页
酒店房间登记与计费管理系统方案.docx_第3页
第3页 / 共25页
酒店房间登记与计费管理系统方案.docx_第4页
第4页 / 共25页
酒店房间登记与计费管理系统方案.docx_第5页
第5页 / 共25页
点击查看更多>>
下载资源
资源描述

酒店房间登记与计费管理系统方案.docx

《酒店房间登记与计费管理系统方案.docx》由会员分享,可在线阅读,更多相关《酒店房间登记与计费管理系统方案.docx(25页珍藏版)》请在冰豆网上搜索。

酒店房间登记与计费管理系统方案.docx

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

 

工业学院

《C语言程序设计》课题报告

题目名称:

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

班级:

电气4班

组长:

王树锦

组员:

贾俊枫

王莹

许茗

王冠

指导教师:

褚洪波

一、程序功能描述

1、屏幕上出现一个界面,让操作员能够方便的选择所需要进行的操作,包括登记入住、查询房间的入住情况、查询当前费用、结账退房等操作。

2、对不同标准的房间实施不同的收费标准,也可以按天收费或按小时收费,可根据顾客需要在登记入住时进行选择。

3、在结账退房时,根据入住时间,计费方式和房间单价计算出总费用。

前台操作:

包括开房登记、退房结账和房状态查看

预订管理:

包括预订房间、预订入住和解除预订

信息查询:

包括在住客人列表、预订客人列表

报表统计:

包括开房记录统计、退房结账和预订房间统计

完成提示:

(1)住店情况记录在住店管理表中:

客人、房号、入住时期、预计离开日期、结账离开日期、应付金额

(2)每个房间的使用情况记录在房间信息表中:

房号、价格、押金、房状态(空,入住)

(3)预定情况记录在预订情况表中:

客人、房号、入住日期、预计离开日期

二、程序流程图

 

三、数据结构设计

创建房间信息结构体

/*创建结构体date,记录入住和结账时间*/

structdate

{intmon;

intday;

inthour;

};

/*创建结构体hotel*/

structhotel

{intnum;//房间号

intkind;/*房间种类1-单人间2-双人间*/

charname[20];//入住客户

charID[19];//身份证号

inth_money;//按日收费价格

intd_money;//按小时收费价格

structdatetime;//入住时间

intflag;/*flag含义0-无人入住1-按小时入住2-按天入住*/

intdeposit;//押金

}room[M];

 

四、总结及体会

组长:

王树锦

实用为主系统以用户需求为目标,以方便用户为原则,同进融入先进的管理经验,在通用的成熟的酒店管理系统的框架下,根据用户的实际需求功能情况,为用户进行二次开发,度身订造一套先进的管理系统,尽可能降低使用前的培训、实施和使用中的维护时间。

充分满足现在及未来的各种需求,真正为管理及决策提供强有力的支持。

我认识到c语言实验是非常注意书写的正确性和逻辑的严密性,实验过程本身就在考验一个人细心与耐心程度,还有对所学知识的熟练程度。

组员1:

贾俊枫

先进灵活系统充分应用现有成熟的网络技术、软件开发技术,先进的客户/服务器结构,及高性能的32位大型网络数据库,满足大型连锁客户的日常运营、移动办公、开展电子商务等的需要。

同时用户可自行灵活设置参数和各种代码,适应自己的特殊需要。

这对我来说是非常重要的方面。

这次试验也让我知道在c语言中,条理清晰的流程是很重要的,它包含你编写程序的大致方向,是你在编程过程中不会走错路,也不会太盲目。

组员2:

王莹

稳定可靠通过选用先进的开发软件,成熟的网络结构及安全可靠的数据库,再配合硬件的优化选型,从而保证系统的可靠性与容错性。

宾馆信息管理系统主要实现宾馆酒店的客房管理、客户信息管理、客户添加管理、客户修改管理、客户删除管理功能。

在实验中,遇到问题要想方设法将它解决,看书找资料,请教同学,与同学讨论,都是很好的途径。

组员3:

许茗

随着社会服务行业的发展,使用管理软件来管理整个宾馆企业的要求也逐年升温,有条件的酒店或宾馆都采用了相关的酒店管理系统,以解决宾馆全凭原始的手工记录管理,效率低、易出错的缺陷。

宾馆行业对自身提供服务的质量和能力也有了更高的要求,宾馆信息管理系统正因此而越来越受到重视。

组员4:

王冠

一个宾馆信息管理系统应该包括基本的客房信息管理、客房客户信息管理、入住退房信息管理等相关的信息管理。

严谨认真的态度也不可或缺。

实验中常常会遇到许多问题,c语言有自己解决问题的方法:

找语法错误,找逻辑错误,调试等等,有时需要从整个程序方面考虑,这就需要调试经验。

五、程序源代码

#include

#include

#include

#include

#include

#include

#include

#include

#defineROOM_MAX100

#defineTYPE_NUM4

#defineWIDTH80

#defineHIGH25

typedefstructtmtm;

typedefenum{False,True}Bool;

typedefenum{Single,Standard,Vip,President}Type;

typedefstructnode

{

void*elem;

structnode*next;

}node_t;

/*房间结构*/

typedefstructroom

{

introom_number;

Boolroom_is_used;

Typeroom_kind;

charguest_name[20];

charguest_Id[19];

doubleroom_price;

tm*start_time;

tm*end_time;

doubletotal_cost;

}room_t;

voidwelcome();

voidmenu();

voidlocate_position();

voidanimal();

voidanimation(intx);

voidgoodbye();

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,node_t*cur,void*arg),

void*arg);

node_t*list_reverse(node_t*head);

voidlist_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);

voidroom_add(node_t*head,room_thotal[TYPE_NUM][ROOM_MAX]);

voidroom_del(node_t*head);

voidprice_info();

intincrease_two(inti);

doubleprice_of_room(Typekind);

char*Type_to_string(Typekind);

char*Bool_to_string(Bool_bool_);

room_t*get_first_room(room_thotal[ROOM_MAX],Typekind);

/**

*increase_two

*

*i要自增的数

*调用一次增加2

*/

intincrease_two(inti)

{

returni+2;

}

/**

*price_of_room

*

*kind房间类型

*根据房间的类型得到房间的单价

*/

doubleprice_of_room(Typekind)

{

returnpow(2,(int)kind)*100;

}

/**

*定位光标

*x要定位的列数

*y要定位的行数

*无返回值

*

*调用API,定位光标位置,比用空格,Tab,回车定位方便许多

*/

voidlocate_position(intx,inty)

{

COORDC;

C.X=x;

C.Y=y;

SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),C);

}

/**

*welcome

*显示欢迎界面(总菜单界面的大部分容)

*列出用户可进行的操作

*每次任务完成后,再次调用些界面

*/

voidwelcome()

{

intposition=4;

locate_position(25,3);

printf("酒店房间登记与计费管理系统");

locate_position(30,position=increase_two(position));

printf("1:

登记入住");

locate_position(30,position=increase_two(position));

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("6:

 关于");

locate_position(30,position=increase_two(position));

printf("0:

退出");

locate_position(27,position=increase_two(position));

printf("请选择要办理的业务\n");

}

voidgoodbye()

{

charis_leave='i';

charstr[15]="color0";

charstr_color[2];

intcolor;

time_ttTime;

tm*tBlock;

locate_position(33,10);

printf("确认退出(Y/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,"color0");

color=rand()%8+8;

itoa(color,str_color,16);

strcat(str,str_color);

system(str);

locate_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);

getch();

exit(0);

}

else

{

system("cls");

menu();

}

}

/**

*price_info

*

*无参数,显示房间的价格

*/

voidprice_info()

{

intposition=1;

intweidth=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,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[VIP房间]%10.2f",Type_to_string((Type)2),price_of_room((Type)2));

locate_position(weidth,position=increase_two(position));

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在第几行展示 

* 其中随着时间流逝,>>>>>>>不断的向右移动

*/

voidanimation(intx)

{

staticinti=1;

locate_position(1,x);

printf("=============================================================================");

locate_position(i%(WIDTH-5),x);

printf(">>>>>");

i+=3;

if(i>WIDTH-5)

{

i=1;

}

}

/**

*和上面的函数相似,这次是向左

*/

voidanimal(intx)

{

staticinti=74;

locate_position(1,x);

printf("-----------------------------------------------------------------------------");

locate_position(i%(WIDTH-5),x);

printf("<<<<<");

i-=5;

if(i<0)

{

i=WIDTH-6;

}

}

/**

*menu

*菜单项

*

*没有参数,显示菜单界面

*根据不同的选项,进入不同的子模块

*/

voidmenu()

{

intcolor;

inti=0,j;

charstr[15];

charstr_color[2];

charch='m';

time_ttTime;

tm*tBlock;

room_thotal[TYPE_NUM][ROOM_MAX];

node_t*head=list_init();

memset(&hotal,0,sizeof(room_t)*TYPE_NUM*ROOM_MAX);

/*初始化房间信息*/

for(i=0;i

{

for(j=0;j

{

hotal[i][j].room_number=(i+1)*100+j;

hotal[i][j].room_kind=(Type)i;

hotal[i][j].room_price=price_of_room((Type)i);

if(i*i+j==12)

{

hotal[i][j].room_is_used=True;

list_add(head,&hotal[i][j]);

}

}

}

 

srand((unsigned)time(NULL));

system("title酒店房间登记与计费管理系统");

while(ch!

='0')

{

ch=kbhit()?

getch():

'm';

switch(ch)

{

case'1':

system("cls");

room_add(head,hotal);

system("pause");

system("cls");

break;

case'2':

system("cls");

printf("\n----------------所有用户信息如下---------------\n\n");

printf("房间号 房间类型  用户名 用户证件 单价\n");

printf("------|----------|-----------|--------------------------|-----------------------\n");

list_for_each(head,mprint,NULL);

system("pause");

system("cls");

break;

case'3':

system("cls");

price_info();

system("pause");

system("cls");

break;

case'4':

system("cls");

room_del(head);

system("pause");

system("cls");

break;

case'0':

system("cls");

goodbye();

break;

default:

break;

}

/*显示动画效果*/

animal(22);

animation

(1);

animation(23);

strcpy(str,"color0");

color=rand()%8+8;

itoa(color,str_color,16);

strcat(str,str_color);

system(str);

welcome();

locate_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(48,20);

_sleep(1000);

}

}

/**

*list_init

*初始化链表,这个链表为循环链表,有头结点

*/

node_t*list_init()

{

node_t*head=(node_t*)malloc(sizeof(node_t));

head->elem=NULL;

head->next=head;

returnhead;

}

/**

*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;

returnnew_node;

}

/**

*list_del

*删除列表中的元素

*

*head列表的头结点

*dest要删除的结点

*给出要删除的结点,从头结点开始找到要删除的结点,然后删除

*表头元素不能删除

*/

node_t*list_del(node_t*head,node_t*dest)

{

node_t*pre=head;

node_t*cur=pre->next;

while(cur!

=dest)

{

if(cur!

=head)

{

pre=pre->next;

cur=cur->next;

}

else

{

returnhead;

}

}

pre->next=cur->next;

/*释放指针后直接赋值为NULL,预防野指针

*free(cur);

*cur=NULL;

*但是这个地方不能free了,因为它的元素包含有房间数组

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > PPT模板 > 国外设计风格

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1