1.具有建立数据文件(客房信息文件、住客信息文件)功能; 2.具有数据输入功能; 3.具有数据修改功能; 4.具有数据删除功能; 5.能查询(查找)一些基本信息(如按房号查询、按姓名查询、空余客房查询等); 6.具有多种统计功能(要求有一定的实用性) (如某客房当前有那些空床、某住客应付多少费用、某天住店总人数和总收入等) 7.能具有排序功能(比如在查询所有的客房信息时,能根据房间价格进行排序,方便客人挑选房间
->state,customer->ID,
customer->room_number,customer->check_in_date,customer->departure_date);
}
void printf_all_customer()//打印全部顾客信息
{
printf( "姓名 性别 年龄 房型 身份证号 房号 入住日期 离开日期\n");
Pcustomer customer = head_customer;
while ( customer != NULL )
{
printf_customer(customer);
customer = customer->next;
}
}
int check_empty_room() //查询空房
{
Proom p = head_room;
int num_empty_room = 0;
printf( "房号 房型 价格 已住人数 \n");
while ( p != NULL )
{
if ( p->Number == 0 )
{
printf_room(p);
num_empty_room++;
}
p = p->next;
}
return num_empty_room;
}
int sum_empty_room()//空房间总数
{
printf("共有空房间%d\n",check_empty_room());
return 0;
}
Proom update_room_less(int room_num) //更新房间信息(离店人数减少)
{
Proom p = check_room_number(room_num);
p->Number = p->Number - 1;
return 0;
}
Proom update_room_add(int room_num) //更新房间信息(进店人数增加)
{
Proom p = check_room_number(room_num);
p->Number = p->Number + 1;
return 0;
}
int delete_customer(char name[10])//退房
{
Pcustomer p,q;
q = p = head_customer;
if (p == NULL)
{
return 0;
}
if (strcmp(p->name,name) == 0)
{
int room_num = p->room_number;
update_room_less(room_num);
if (r_customer == head_customer)
{
printf("退房成功!\n");
head_customer = r_customer = NULL;
return 1;
}
head_customer = head_customer->next;
free(p);
printf("退房成功!\n");
return 1;
}
p = p->next;
while (p != NULL&& 0 != strcmp(p->name,name))
{
p = p->next;
q = q->next;
}
if(p == NULL)
{
printf("此人不在此店!\n");
return 0;
}
else
{
int room_num = p->room_number;
update_room_less(room_num);
if (p == r_customer)
{
r_customer = q;
}
q->next = p->next;
free(p);
printf("退房成功!\n");
return 1;
}
}
Pcustomer update_customer(char name[10])//住客换房
{
delete_customer(name);
insert_post_link_customer();
return NULL;
}
int count_day( int, int, int, int ); //计算两个日期中间的天数
int leap( int );//平闰年计算
int sum_data( Pcustomer customer ) //计算顾客所住天数
{
int year, day, day1, day2;
int s_year, s_month, s_day, e_year, e_month, e_day;//s为起始的日期,e为终止日期
e_day = customer->departure_date%100;
e_month = customer->departure_date/100%100;
e_year = customer->departure_date/10000;
s_day = customer->check_in_date%100;
s_month = customer->check_in_date/100%100;
s_year = customer->check_in_date/10000;
if ( s_year < e_year ) //不同年的时间判断
{
day = count_day ( s_year, s_month, s_day , 0 );
for (year=s_year+1;year<e_year; year++ )//年份累加
if (leap(year))//闰年
day += 366;
else //平年
day += 365;
day += count_day (
数据结构与算法课程设计说明报告书 ——简易客房管理系统_工学_高等教育_教育专区...在代码 实现上,住客登记录入的信息直接进入相应的链表并转存 Customer 文件中,...
学生成绩管理系统源代码 (数据结构与算法课设)C语言版_计算机软件及应用_IT/计算机_专业资料。 运行前 需在功程里新建个 ni.txt.内容如下 7 004 005 002 006...
数据结构课程设计 宾馆客房管理系统_计算机软件及应用...各功能模块源代码及详细介绍 (1) .主菜单 Init (...我想宾馆管理系统的算法和学生宿舍管理系统一样,所以...
数据结构课程设计报告(附源代码)-学生管理系统_工学...录入功能: 该功能实现良好,操作也较简单,程序运行时...的课设进行互相交换修改意见,学习别人的新算法或...
(桂电)学生成绩管理系统... 31页 2下载券 学生成绩管理系统源代码... 19页...简单学生成绩管理系统设... 52页 2下载券 数据结构与算法课程设计... 暂无评价...
《C++课程设计·酒店客房管理系统_理学_高等教育_教育...客房信息涉及的数据有 客房编号、客房类型、住房天数...图 7 所有客房的信息 4.关键代码分析(1)系统的...
数据结构课程设计各种排序算法比较 附带源代码_理学_...操作系统 windows 运行环境 vc6.0 算法设计的思想 ...用简单链表管理员工信息 20页 免费 排序算法集合 18...
数据结构课程设计报告图书馆管理系统(含源代码)_计算机软件及应用_IT/计算机_专业资料。数据结构课程设计报告图书馆管理系统今日推荐 78...
用C语言实现的宾馆客房管理系统课程设计报告_计算机软件...三、算法设计的思想 1.定义宾馆客房管理信息结构体 ...5.源程序可运行之后,将其数据、信息输入到文档中,...
大学C程序设计,课程设计客房管理系统源代码。...( ); //定义全局结构体变量,且里面又调用两个结...数据库客房管理系统 4页 免费 客房管理系统 22页 ...
热门文档