1.具有建立数据文件(客房信息文件、住客信息文件)功能; 2.具有数据输入功能; 3.具有数据修改功能; 4.具有数据删除功能; 5.能查询(查找)一些基本信息(如按房号查询、按姓名查询、空余客房查询等); 6.具有多种统计功能(要求有一定的实用性) (如某客房当前有那些空床、某住客应付多少费用、某天住店总人数和总收入等) 7.能具有排序功能(比如在查询所有的客房信息时,能根据房间价格进行排序,方便客人挑选房间
e_year, e_month, e_day, 1);
}
else if ( s_year == e_year ) //同一年的时间判断
{
day1 = count_day ( s_year, s_month, s_day, 1 );
day2 = count_day ( e_year, e_month, e_day, 1 );
day = day2-day1;
}
else
day = 1;
return day;
}
//计算天数的核心
int count_day ( int year, int month, int day, int flag )
{
static int day_tab[2][12] = {{31,28,31,30,31,30,31,31,30,31,30,31},{31,29,31,30,31,30,31,31,30,31,30,31}};
int p, i, s;
if (leap(year)) //闰年为1选择后面的用
p = 1;
else
p = 0;
if (flag)
{
s = day;
for ( i = 1; i < month; i++ )
s += day_tab[p][i-1];
}
else
{
s = day_tab[p][month] - day;
for ( i = month + 1; i <= 12; i++ )
s += day_tab[p][i-1];
}
return ( s );
}
//平闰年的判断
int leap(int year)
{
if ( year%4 == 0&&year%100!=0||year % 400 ==0)
return 1;
else
return 0;
}
void sum_customer_price( Pcustomer customer)//顾客应付总价格
{
int num_price;
Proom p = check_room_number(customer->room_number );
if (NULL != p)
{
num_price = sum_data (customer) * ( p->Price );
printf( "房客应付款%d元\n",num_price );
}
}
int total_customer_numer(Proom room)//顾客总人数
{
Proom p;
p = head_room;
int num = 0;
while ( p != NULL )
{
num=num+p->Number;
p=p->next;
}
return num;
}
int total_price_day( Proom head_room)//当天总收入
{
Proom p;
p = head_room;
int num_price = 0;
while ( p != NULL )
{
if ( p->RoomType == 3 )
{
num_price=num_price +(p->Price) * (p->Number);
p=p->next;
}
else
{
num_price=num_price +p->Price;
p=p->next;
}
}
return num_price;
}
//按单价给客房排序(插入排序)
void sort_insert(Proom room)
{
Proom pre,now,p,q;
pre = head_room->next;
if ( pre == NULL ) return;
now = pre->next;
if ( now == NULL ) return;
while ( now != NULL )
{
q = head_room;
p = head_room->next;
while (p != now && p->Price <= now->Price )
{
q = p;
p = p->next;
}
if( p == now )
{
pre = pre->next;
now = pre->next;
continue;
}
pre->next = now->next;
q->next = now;
now->next = p;
now = pre->next;
}
}
//按房号给住客信息排序(冒泡排序)
void sort_bubble()
{
Pcustomer p, q, pre;
pre = head_customer;
p = head_customer->next;
if ( p = NULL ) return;
q = p->next;
if ( q = NULL ) return;
int noswap;
int num_customer = total_customer_numer(head_room);
for ( int i = 0; i < num_customer-1; i++ )
{
noswap = 1;
for ( int j = 0; j < num_customer-i-1; j++ )
//while ( q != NULL )
if ( p->room_number > q->room_number )
{
pre->next = q;
p->next = q->next;
q->next = p;
q = p->next;
noswap = 0;
}
if ( noswap ) break;
}
}
void update_room_type(int num)// 修改房
数据结构与算法课程设计说明报告书 ——简易客房管理系统_工学_高等教育_教育专区...在代码 实现上,住客登记录入的信息直接进入相应的链表并转存 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页 ...
热门文档