文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > IT/计算机 > 计算机软件及应用 > 数据结构与算法课设源代码——简易客房管理系统
侵权投诉

数据结构与算法课设源代码——简易客房管理系统

1.具有建立数据文件(客房信息文件、住客信息文件)功能; 2.具有数据输入功能; 3.具有数据修改功能; 4.具有数据删除功能; 5.能查询(查找)一些基本信息(如按房号查询、按姓名查询、空余客房查询等); 6.具有多种统计功能(要求有一定的实用性) (如某客房当前有那些空床、某住客应付多少费用、某天住店总人数和总收入等) 7.能具有排序功能(比如在查询所有的客房信息时,能根据房间价格进行排序,方便客人挑选房间

fwrite(temp_node,sizeof(struct Customer),1,filep);
temp_node = temp_node->next;
}
fclose(filep);
return 1;
}

int insert_post_link_room () //插入房间
{
Proom temp_node = (Proom)malloc(sizeof(struct Room));
if (temp_node == NULL)
{
printf( "out of space!!!\n");
return 0;
}

printf("请输入房间号\n");
scanf("%d", &temp_node->RoomNumber);
printf("请输入房型:1<单间>,2<双人间>,3<通铺>\n");
scanf("%d", &temp_node->RoomType);
printf("请输入价格\n");
scanf("%d", &temp_node->Price);
printf("请输入已住人数\n");
scanf("%d", &temp_node->Number);

temp_node->next=NULL;
if (head_room == NULL)
{
head_room = r_room = temp_node;
}
else
{
r_room->next= temp_node;
r_room = temp_node;
}
return 0;
}

int insert_post_link_customer ()//顾客信息插入
{
Pcustomer temp_node = (Pcustomer)malloc(sizeof(struct Customer));
if (temp_node == NULL)
{
printf( "out of space!!!\n");
return 0;
}
printf("请输入姓名\n");
scanf("%s", temp_node->name);
printf("请输入年龄\n");
scanf("%d", &temp_node->age);
printf("请输入身份证号码\n");
scanf("%s", temp_node->ID);
printf("请输入性别\n");
scanf("%s", temp_node->sex);
printf("请输入房号\n");
scanf("%d", &temp_node->room_number);
printf("请选择房型:1<单间>,2<双人间>,3<通铺>\n");
scanf("%d", &temp_node->state);
printf("请输入入住日期(输入八位数,如20120901)\n");
scanf("%d", &temp_node->check_in_date);
printf("请输入退房日期(输入八位数,如20120901)\n");
scanf("%d", &temp_node->departure_date);

temp_node->next =NULL;

if (head_customer == NULL)
{
head_customer = r_customer = temp_node;
}
else
{
r_customer->next = temp_node;
r_customer = temp_node;
}

update_room_add(r_customer->room_number);
return 1;

}

int is_null_list_room(Proom list)
{
return (list->next == NULL);
}

int is_null_list_customer(Pcustomer list)
{
return (list->next == NULL);
}

Proom check_room_number(int room_number )//按房号查询出保存房间信息节点
{
Proom p = head_room;
while ( p != NULL && p->RoomNumber != room_number)
p = p->next;
return p;
}

Pcustomer check_customer_name(char name[10] )//按房客姓名查询顾客信息节点
{
Pcustomer q = head_customer;
while (q!=NULL&&0!=strcmp(q->name,name))
q=q->next;
return q;
}

void printf_room( Proom room)//打印单个房间信息
{
printf( "%d %d %d %d\n",
room->RoomNumber,room->RoomType,room->Price,room->Number);
}

void printf_all_room()//打印房间信息
{
printf( "房号 房型 单价 已住人数\n");
Proom room = head_room;
while ( room != NULL )
{
printf_room(room);
room = room->next;
}
}

void printf_customer( Pcustomer customer)//打印单个顾客信息
{
printf( "%s %s %d %d %s %d %d %d\n",
customer->name,customer->sex,customer->age,customer

上一页第2页

你可能喜欢

  • 数据结构学生信息管理系统
  • C语言图书管理系统课程设计
  • c学生成绩管理系统课程设计
  • 信息系统管理办法
  • 02382管理信息系统
  • 数据结构停车场管理
  • 学生管理系统详细设计
  • C++银行管理系统

热门文档

相关文档

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email