宾馆客房管理软件.docx

上传人:b****8 文档编号:11897136 上传时间:2023-06-03 格式:DOCX 页数:13 大小:131.55KB
下载 相关 举报
宾馆客房管理软件.docx_第1页
第1页 / 共13页
宾馆客房管理软件.docx_第2页
第2页 / 共13页
宾馆客房管理软件.docx_第3页
第3页 / 共13页
宾馆客房管理软件.docx_第4页
第4页 / 共13页
宾馆客房管理软件.docx_第5页
第5页 / 共13页
宾馆客房管理软件.docx_第6页
第6页 / 共13页
宾馆客房管理软件.docx_第7页
第7页 / 共13页
宾馆客房管理软件.docx_第8页
第8页 / 共13页
宾馆客房管理软件.docx_第9页
第9页 / 共13页
宾馆客房管理软件.docx_第10页
第10页 / 共13页
宾馆客房管理软件.docx_第11页
第11页 / 共13页
宾馆客房管理软件.docx_第12页
第12页 / 共13页
宾馆客房管理软件.docx_第13页
第13页 / 共13页
亲,该文档总共13页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

宾馆客房管理软件.docx

《宾馆客房管理软件.docx》由会员分享,可在线阅读,更多相关《宾馆客房管理软件.docx(13页珍藏版)》请在冰点文库上搜索。

宾馆客房管理软件.docx

宾馆客房管理软件

 

1.问题描述3

2.基本要求3

3.系统分析和设计3

4.流程图5

5.程序清单6

6.测试数据10

7.小结及收获和体会11

8.参考资料12

 

一、问题描述

当今社会旅游成为一种时尚,住宿便成为了旅游中的问题。

越来越多的旅客加重了旅馆登记,运作负担。

如果有一款软件可以代替人工操作,将会极大的提高工作效率。

二、基本要求

1)某宾馆有301、302、303、304、305五个标准间,每个标准间可住2人;

2)链表存储结构:

姓名、性别、房号、后续指针,按房间号有序;

3)能实现入住(注意性别)和退房,能按给定姓名、房号查询;

4)建议采用链表结构,但用其它方法实现也可。

三、系统分析和设计

(1)市场分析

随着我国市场经济的迅速发展和人们生活水平的不断提高,宾馆酒店业的竞争越来越激烈。

要想在竞争中取得优势,必须在经营管理、产品服务等方面提高服务管理意识。

而对宾馆的经营起决定作用的是客房管理。

越来越多的宾馆管理人员已经意识到使用计算机网络和管理系统的重要性。

(2)系统主要功能包括:

(1)住房管理:

住宿登记、客户退房

(2)客房管理:

客房查询

(3)

详细设计说明

①结构体:

structcustomer

{

intnum;

charname[20];

charsex;

structcustomer*next;

}cus;

②相关函数:

structcustomer*creat(void)/*定义函数,此函数带回一个指向链表头的指针*/

structcustomer*insert(structcustomer*head,structcustomer*consumer)/*插入登记客户信息函数*/

structcustomer*del(structcustomer*head,intnum)/*删除节点(客户退房的程序*/

structcustomer*search(structcustomer*head,charc_name[])/*寻找客户信息的程序*/

voidprint(structcustomer*head)/*在登记和退房时输出登记入住宾馆人员信息*/

(4)设计中的问题:

由于链表的创建和文件操作上的课较少,加之程序设计时间较紧,上述源程序还有很多不完善之处。

上述原代码中

structcustomer*insert(structcustomer*head,structcustomer*consumer)和

structcustomer*search(structcustomer*head,charc_name[])两个函数没有调试通过;寻找信息函数没有调试成功,在查找时得到的信息不对;insert函数运行还不是很完善。

总之,在编写程序时遇到了很多问题。

也有一些问题得到了解决,如在编写insert函数时开始输入不了数据,后来查找资料,用malloc函数开辟了一个空间,可以完成数据的输入。

在编写程序时我还是学到了很多。

 

四、流程图

五、程序清单

#defineNULL0

#defineLENsizeof(structcustomer)

#include"string.h"

structcustomer

{

intnum;

charname[20];

charsex;

structcustomer*next;

}cus;

structcustomer*creat(void)/*定义函数,此函数带回一个指向链表头的指针*/

{

structcustomer*head,*p1,*p2;

intn=0;

p1=(structcustomer*)malloc(LEN);

p2=(structcustomer*)malloc(LEN);

printf("qingshurukehudexinxi:

\n");

printf("\nfangjian:

");

scanf("%d",&p1->num);

printf("\n");

printf("xingming:

");

scanf("%s",p1->name);

printf("\n");

printf("xingbie:

");

scanf("%s",&p1->sex);

printf("\n");

head=NULL;

while(p1->num!

=0)

/*创建链表,当输入值不为0时创建节点并添加值,继续重复;若输入值为0,结束循环并返回头节点指针。

*/

{

n++;

if(n==1)

head=p1;

else

p2->next=p1;

p2=p1;

p1=(structcustomer*)malloc(LEN);

printf("qingshurukehudexinxi:

\n");

printf("\nfangjian:

");

scanf("%d",&p1->num);

printf("\n");

printf("xingming:

");

scanf("%s",p1->name);

printf("\n");

printf("xingbie:

");

scanf("%s",&p1->sex);

printf("\n");

}

p2->next=NULL;

return(head);

}

structcustomer*insert(structcustomer*head,structcustomer*consumer)

{

structcustomer*p1,*p2;

p1=head;

p2=consumer;

while(p1->next!

=NULL)

p1=p1->next;

if(p1->next==NULL)

{

p1->next=p2;

p2->next=NULL;

}

return(head);

}

structcustomer*del(structcustomer*head,intnum)/*删除节点的程序*/

{

structcustomer*p1,*p2;

if(head==NULL)/*是空表*/

{

printf("meiyoukehuxinxi\n");

return(head);

}

p1=head;/*P1指向第一个节点*/

while(num!

=p1->num&&p1->next!

=NULL)/*P1不是所要指向的节点,且后面还有节点*/

{

p2=p1;p1=p1->next;/*P1后移一个节点*/

}

if(num==p1->num)/*找到了*/

{

if(p1==head)

head=p1->next;/*若P1是首节点,把第二个节点地址赋予head*/

else

p2->next=p1->next;/*否则将下一个节点地址赋给head*/

printf("tuifangxinxi:

\n");

printf("kefang:

%d\n",&p1->num);

printf("xingming:

%s\n",p1->name);

printf("xingbie:

%s\n",&p1->sex);

}

else

printf("meiyougaikehudexinxi\n");

return(head);

}

structcustomer*search(structcustomer*head,charc_name[])

{

structcustomer*p;

p=head;

while(strcmp(p->name,c_name)&&p->next!

=NULL)/*输入的字符和结构体中的name不相等*/

p=p->next;

if(p->name==c_name)

{

printf("gaikehudexinxiwei:

\n");

printf("fangjian:

%d\nxingming:

%s\nxingbie:

%c",p->num,p->name,p->sex);

}

if(p->name!

=c_name&&p->next==NULL)

printf("meiyougaikehuxinxi!

\n");

}

voidprint(structcustomer*head)/*输出宾馆人员信息*/

{

structcustomer*p;

printf("\nxianyoukehuxinxiwei:

\n");

p=head;

if(head!

=NULL)

do

{

printf("kefang:

%d\n",p->num);

printf("xingming:

%s\n",p->name);

printf("xingbie:

%c\n",p->sex);

p=p->next;

}while(p!

=NULL);

}

main()

{

structcustomer*head,*p;

intm,number;

charc_name[20];

printf("\n");

printf("*************************************************\n");

printf("huanyingjinrubinguankefangguanlixitong\n");

printf("*************************************************\n");

printf("*************************************************\n\n");

printf("1:

jianku\n");/*creat*/

printf("2:

dengji\n");/*insert*/

printf("3:

tuifang\n");/*del*/

printf("4:

chaxun\n");/*search*/

printf("*************************************************\n\n");

printf("zhixingchaozuo:

\n");

scanf("%d",&m);

if(m==1)/*建库*/

head=creat();

else

if(m==2)/*登记*/

{

printf("qingshuruyaodengjidekehuxinxi:

");

p=(structcustomer*)malloc(LEN);

printf("fangjian;xingming;xingbie:

");

scanf("%d%s%c",&p->num,p->name,&p->sex);

head=insert(head,p);

print(head);/*输出登记人员的信息*/

}

else

if(m==3)/*退房*/

{

printf("qingshuruyaotuifangkehudefangjianhao:

");

scanf("%d",&number);

head=del(head,number);

print(head);/*输出登记人员的信息*/

}

else

if(m==4)/*查询*/

{

printf("qingshuruyaochaxunkehudexingming:

");

scanf("%s",c_name);

search(head,c_name);

}

else

printf("zhixingchaozuocuowu!

");

}

六、测试数据

 

七、小结及收获和体会

这次课题设计对自己来说是一次新的尝试,我选的课题是宾馆客房管理软件,这个课题必须要协助课外的知识才能完成。

记得当时开始做的时候真的是一头雾水,都开始后悔自己选了这个课题,还没和同学组队,当时想就从网上下程序或者从其他人那拷来程序交了吧,可是当看到大二学长们的课题报告时,我犹豫了,他们也都是自己编的,为什么他们能做到我不可以呢!

趁着一股劲儿,我从图书馆借来了程序设计方面的书,花了几天的时间把和这个课题有关的知识看了一遍,当时看过之后还是挺迷糊的,然后开始尝试着编,发现真正编起来也不是很难,终于花了一上午的时间把程序编好了。

随后找时间去了机房调试,开始时出现的问题还挺多的。

在编辑编译时出现了定义方面的错误,不过根据错误提示经过稍加修改后终于看到了期待的“success”!

在运行时,终于看到了自己想看到的结果。

但是离预期目标还有一定差距,还不能实现入住区分性别的双人间,这也是一个很大的遗憾。

此次课程设计我主要负责编写、输入代码的任务,面对密密麻麻的字符,我发现程序员是一个比较辛苦的职业。

首先面对难题时要镇静,想好解决方法,然后要坚持去做好;要广泛利用课外书籍资料,通过自学获得知识完成自己的探索,这次实验过程极大地锻炼了自己面对难题,独立思考,自己探索,发现问题,解决问题的能力。

但是,最终我还是证明了自己的实力,面对了这种种的挑战,相信我未来一定会在这条路上走更远。

八、参考资料

[1]谭浩强,《C程序设计教程》,清华大学出版社,2007年

[2]谭浩强编著,《C程序设计》,清华大学出版社,1991年

[3]BrianW.Kernighan,DennisM.Ritchie,TheCProgrammingLanguage,ChinaMachinePress,2006.

[4]宾馆管理系统的设计马秀莲,高志安边疆经济与文化(THEBORDERECONOMYANDCUCTURE)2005年第2期(总第14期)

[5]宾馆客房信息管理系统的设计与实现赵建功,秦晓明襄樊职业技术学院学报(JournalofXiangfanVocationalandTechnicalCollege)第4卷第4期2005年8月

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

当前位置:首页 > 人文社科 > 法律资料

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2