资源简介
C++ 写客房管理系统,代码无错误,含详细说明和开发论文

代码片段和文件信息
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
struct date //日期
{
int year;
int month;
int day;
int house;
int minute;
} ;
struct Room //房间结构体
{
int number; //房号 每层10给房 一个类型房间号如:101到110 801到810
int type; //房型 1、标准单人房(100¥/晚) 2、标准双人房(180¥/晚) 3、豪华单人房(150¥/晚) 4、豪华双人房(250¥/晚) 5、行政房(200¥/晚) 6、商务房(200¥/晚) 7、家庭间(250¥/晚) 8、蜜月间(250¥/晚)
double price; //价格
int state; //状态 0空闲,1预订 2已入住
};
class CustomerNode //顾客节点
{
public:
CustomerNode(){};
CustomerNode(int type);
char name[20]; //姓名
char ID[18]; //身份证号码
char zhiye[30]; //职业
int roomNumber; //入住房号
int roomType; //入住房型
int bookTotal; //预订套数
char sex; //性别
int age;
date inDate; //入住时间
date outDate; //离开时间
CustomerNode *next;
};
class CustomerList{
public:
CustomerList(){ head=tail=0; };
void insert( CustomerNode *p);
void deleteNode(CustomerNode *tempCustomerNode *p);
CustomerNode *head*tail;
};
CustomerList lst2; //链表2存放预订信息
CustomerList lst; //链表存放顾客入住信息
void CustomerList::insert(CustomerNode *p){ //插入在头结点
p->next=head;
head=p;
}
void CustomerList::deleteNode(CustomerNode *tempCustomerNode *p){ //删除
if(p->next==0 && temp!=p) {temp->next=0; delete(p);}
else{
if(temp==p) {
p=p->next;
lst2.head=lst2.head->next;
// delete(p);
}
else{
temp->next = p->next;
delete(p);
}
}
}
CustomerNode::CustomerNode(int type) //构造函数
{
roomType=type;
cout<<“请输入顾客姓名:“;
cin>>name;
while(1){
cout<<“请您输入顾客的身份证号码(18位): “;
cin>>ID;
if(strlen(ID)==18) break;
else cout<<“请正确输入身份证号码!“< }
cout<<“请输入顾客年龄:“;
cin>>age;
cout<<“请输入顾客职业:“;
cin>>zhiye;
while(1){
cout<<“请输入顾客性别(f/m):“;
cin>>sex;
if(sex==‘f‘||sex==‘m‘) break;
else cout<<“请正确输入性别!“< }
time_t t = time(NULL);
tm* pt = localtime(&t);
inDate.year = 1900 + pt->tm_year;
inDate.month = pt->tm_mon + 1;
inDate.day = pt->tm_mday;
inDate.house = pt->tm_hour;
inDate.minute = pt->tm_min;
//next = ptr;
// cout<<1900 + pt->tm_year<<‘-‘<tm_mon + 1<<‘-‘<tm_mday<<‘ ‘<tm_hour<<‘:‘<tm_min<<‘:‘<tm_sec<<‘\n‘;
};
int totalroom=80; //酒店总房间数
Room room[811]; //全局变量
string roomTypeNames[9] = {“oo““标准单人房““标准双人房““豪华单人房““豪华双人房““行政房““商务房““家庭间““蜜月间“};
int totalday[13] = {0312931303130313130313031};
//登录函数
int password(){
int flag=1;
string passname;
string passwords;
for(int i=0;i<3;i++){
cout<<“请输入用户名(初始用户000):“;
cin>>passname;
cout<<“请输入密码(初始密码000):“;
cin>>passwords;
if(passname==“000“&&passwords==“000“){ //初始密码为000 000 进入系统后可以修改
flag=0;
return 1;
break;
}
else{
cout<<“输入错误!请重试“< }
}system(“cls“);
if(flag==0){
return 0;}
system(“cls“);
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 49 2011-09-08 08:18 客房管理系统(含一万字论文)\debug\CustomerBookInformation.txt
文件 614 2011-09-07 20:12 客房管理系统(含一万字论文)\debug\CustomerInformation.txt
文件 0 2011-09-07 20:33 客房管理系统(含一万字论文)\debug\manage.txt
文件 1040 2011-09-07 20:12 客房管理系统(含一万字论文)\debug\RoomInformation.txt
文件 217088 2011-09-08 08:15 客房管理系统(含一万字论文)\debug\客房管理系统.exe
文件 38 2011-11-04 11:59 客房管理系统(含一万字论文)\客房管理系统\CustomerBookInformation.txt
文件 584 2011-11-04 11:59 客房管理系统(含一万字论文)\客房管理系统\CustomerInformation.txt
文件 8906 2011-09-08 08:15 客房管理系统(含一万字论文)\客房管理系统\Debug\BuildLog.htm
文件 67 2011-09-08 08:15 客房管理系统(含一万字论文)\客房管理系统\Debug\mt.dep
文件 101376 2011-09-08 08:15 客房管理系统(含一万字论文)\客房管理系统\Debug\vc80.idb
文件 145 2011-09-08 08:15 客房管理系统(含一万字论文)\客房管理系统\Debug\客房管理系统.exe.intermediate.manifest
文件 335775 2011-09-08 08:15 客房管理系统(含一万字论文)\客房管理系统\Debug\客房管理系统.obj
文件 7 2011-11-04 12:00 客房管理系统(含一万字论文)\客房管理系统\manage.txt
文件 1040 2011-09-08 08:15 客房管理系统(含一万字论文)\客房管理系统\RoomInformation.txt
文件 23800 2011-09-08 08:17 客房管理系统(含一万字论文)\客房管理系统\客房管理系统.cpp
文件 3051 2011-08-29 21:56 客房管理系统(含一万字论文)\客房管理系统\客房管理系统.vcproj
文件 1427 2011-09-08 08:17 客房管理系统(含一万字论文)\客房管理系统\客房管理系统.vcproj.MICROSOF-A0E2F2.Administrator.user
文件 2337792 2011-09-08 08:17 客房管理系统(含一万字论文)\客房管理系统.ncb
文件 919 2011-08-29 21:53 客房管理系统(含一万字论文)\客房管理系统.sln
..A..H. 13824 2011-09-08 08:17 客房管理系统(含一万字论文)\客房管理系统.suo
文件 963584 2011-11-04 11:58 客房管理系统(含一万字论文)\论文.doc
目录 0 2011-11-04 11:56 客房管理系统(含一万字论文)\客房管理系统\Debug
目录 0 2011-11-04 11:56 客房管理系统(含一万字论文)\debug
目录 0 2011-11-04 11:56 客房管理系统(含一万字论文)\客房管理系统
目录 0 2011-11-04 11:59 客房管理系统(含一万字论文)
----------- --------- ---------- ----- ----
4011126 25
- 上一篇:信号FFT变换及绘图
- 下一篇:井字棋 α-β剪枝算法
相关资源
- 国际象棋的qt源代码
- C++中头文件与源文件的作用详解
- C++多线程网络编程Socket
- VC++ 多线程文件读写操作
- 利用C++哈希表的方法实现电话号码查
- 移木块游戏,可以自编自玩,vc6.0编写
- C++纯文字DOS超小RPG游戏
- VC++MFC小游戏实例教程(实例)+MFC类库
- 连铸温度场计算程序(C++)
- 6自由度机器人运动学正反解C++程序
- Em算法(使用C++编写)
- libstdc++-4.4.7-4.el6.i686.rpm
- VC++实现CMD命令执行与获得返回信息
- 白话C++(全)
- C++标准库第1、2
- 大数类c++大数类
- C++语言编写串口调试助手
- c++素数筛选法
- C++ mqtt 用法
- 商品库存管理系统 C++ MFC
- c++ 多功能计算器
- C++17 In Detail
- 嵌入式QtC++编程课件
- 颜色识别形状识别STM103嵌入式代码
- c++ 邮件多附件群发
- c++ 透明代理(hookproxy)
- mfc 调用redis
- FTP客户端源码(c++)
- c++ 画图(14Qt-XPS)
- c++多边形交并差运算
评论
共有 条评论