酒店管理系统软件系统(2)

2019-01-07 14:07

五. 编码实现 我负责的是: 客房信息的录入; 客房信息的删除 客房信息的修改

void AddtheGuestroom(tList *tListGue)// 输入客房函数 {

cGuestroom tempGuestroom; //定义临时客房 cout<<\下面开始添加客房信息\\n\ cout<<\请输入入住的客房编号:\

cin>>tempGuestroom.ID; //读入客房编号

cout<<\请输入客房类型:(single,standard,junior suite,deluxe suite)\

cin>>tempGuestroom.Type; //读入客房类型 cout<<\请输入客人定房日期:\

cin>>tempGuestroom.Book; //读入定房日期 cout<<\请输入客房价格:\

cin>>tempGuestroom.Price; //读入价格

6

cout<<\请输入客房的主要内容:(computer,bathroom,air conditioner)\

cin>>tempGuestroom.Function; //读入主要内容 cout<<\请输入客房入住有效期:\

cin>>tempGuestroom.StayTime; //读入入住有效期 tempGuestroom.flag=true; tListGue->Insert(tempGuestroom); cout<<\添加成功!\\n\

system(\:停顿,终止 system(\}

void SaveData(tList *tListGue) //保存数据 {

int i=0;

ofstream ofile(\//创建一个输入文件流对象 if (!ofile) {

7

cerr << \保存时打开文件出错!\ }

cNode *p; p=tListGue->head->next; while(p) {

//内存中读取数据,存到外盘 if(p->data.flag) {

ofile<<\

ofile<<(p->data).ID<<\ ofile<<(p->data).Type<<\ ofile<<(p->data).Book<<\ ofile<<(p->data).Price<<\ ofile<<(p->data).Function<<\ ofile<<(p->data).StayTime<<\ }

p=p->next; }

cout<<\保存数据成功!\\n\ ofile.close();

从8

system(\ system(\ return; }

void ModifytheGuestroom(tList *tListGue) //修改客房信息 {

char id[BUFSIZE];

cout<<\请输入你要查找的客房编号:\

cin>>id; //读取客房编号 bool flag=false; cNode *p; p=tListGue->head->next; while(p) {

if(strcmp(p->data.ID,id)==0 && p->data.flag) {

flag=true;

9

break; }

p=p->next; }

if(flag==true) {//显示屏幕

cout<<\找到了,该客房的原始信息是:\\n\

cout<<\客房编号:\客房类型:\

期:\价格:\ cout<<\容

入主住

要有

内效

:\

期:\

cout<<\下面开始修改该客房的信息:\\n\

cGuestroom tempGuestroom; //定义临时客房

cout<<\请输入客房的客房编号:\

cin>>tempGuestroom.ID; //读入客房编号

cout<<\

请输入客房的客房类型

:

(single,standard,junior suite,deluxe suite)\

10


酒店管理系统软件系统(2).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:2009年普通高等学校招生全国统一考试(湖北卷)(数学理) 有答

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: