第一范文网 - 专业文章范例文档资料分享平台

客房管理系统源代码

来源:用户分享 时间:2025/7/29 12:48:52 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

#include #include #include using namespace std;

/*问题描述:该系统能简单实现对客栈的住宿情况进行管理。至少包括以下信息: 房号、房型、单价(每床)、已住人数;

住客姓名、性别、年龄、身份、身份证号码,房号,床号,入住日期、入住时间、离店日期、离店时间。

这些信息应存放在两个文件中,分别是客房信息文件、住客信息文件。\房型\可取值1-3,分别表示单人间、双人间、通铺(可以住很多人的房间) 功能要求:

1.具有建立数据文件(客房信息文件、住客信息文件)功能; 2.具有数据输入功能; 3.具有数据修改功能; 4.具有数据删除功能;

5.能查询(查找)一些基本信息(如按房号查询、按姓名查询、空余客房查询等);

6.具有多种统计功能(要求有一定的实用性) (如某客房当前有那些空床、某住客应付多少费用、某天住店总人数和总收入等) 说明:

(1)功能各方面越完善越好

(2)自定义的数据结构可以使用数组,链表,树等,可以使用多种数据结构来存放数据,然后在其上使用不同的排序算法。

(3)若用数组,必须动态分配空间(文本文件中最好有一行来表示数组应该有多大,这样便于动态分配空间) */

//*************************************************类定义 class Customer //住客信息类 {

public:

string name; //姓名

string id; //身份证号 string sex;//性别 int age; //年龄

int roomnum; //入住房号 string ruzhum; //入住日期 string ruzhut;//入住时间 string lidianm;//离店日期 string lidiant;//离店时间 int staytime; //入住天数

Customer() { name=\无\ id=\ sex=\ age= -1; roomnum=0; ruzhum=\ ruzhut=\ lidianm=\ lidiant=\ staytime=0; };

~Customer(){}; };

class Room //客房类 {

public:

int num;//房号 int price; //价格 string type; //类型

int renshu; //入住人数 int yajin; //客房押金

Room() { num=0; price=0; type=50; renshu=0;

yajin=0; };

~Room(){}; };

//**************************************************************************************客房信息录入功能

void room_luru(Room *room); void room_luru2(Room *room);

void room_luru(Room *room)//无房,添房函数 {

if(room[0].num==0) { int size; static int Number=300; cout<<\目前暂无房间信息,请添加!\ cout<<\请输入要添加的房间数:\ cin>>size; for(int i=0;i>room[i].type; cout<<\房间价格:\ cin>>room[i].price; cout<

else { string P; cout<<\客房信息已有,是否还要添加房间?(Y/N)\ cin>>P; if(P==\ room_luru2(room); else if(P==\ cout<<\已取消房间添加.\ else cout<<\此操作非法!\ };

system(\ system(\ };

//****************************************************************************

void room_luru2(Room *room)//有房,添加房间函数 {

static int Number=300; string P; do{ // int Number=300; for(int i=0;i<30;i++) { if(room[i].num==0) { room[i].num=Number++;

搜索更多关于: 客房管理系统源代码 的文档
客房管理系统源代码.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c3hg1i2355h23x6i11fyp2nsft0iv0l00r51_1.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top