简易酒店管理系统代码(5)

2019-03-10 21:04

printf(\没有住客的信息.\\n\ return ; } else { for (p; p; p=p->next) { i++; } printf(\已经有%d名住客.\\n\ printf(\ //还没写好 对于不同的房型的情况 } }

//还要写一个函数判断住客住的房间是什么类型的,这样才能确定房间的价钱,才能算出价钱

float the_house_money(link_guest p) { //float money; int i=0; for (i=0;i<10;i++) { if (strcmp(p->room,h[i].house_number)==0) { return h[i].house_price; } } return 0; }

//算出住客应该付多少钱

float pay_for_house_money(struct tm *pstr,link_guest p) { float money; int year;

int month; int day; year=(pstr->tm_year)-(p->p->tm_year); month=(pstr->tm_mon)-(p->p->tm_mon); day=(pstr->tm_mday)-(p->p->tm_mday); day=year*365+month*30+day; if (day<1) { day=1; } money=the_house_money(p); money=day*money; return money; }

//结账的时间

tm *pay_for_time() { time_t timep; //struct tm *p; struct tm *pstr; time(&timep); pstr=gmtime(&timep); printf(\年%d月%d日 %s \(1+pstr->tm_mon), pstr->tm_mday, wday[pstr->tm_wday]); printf(\ return pstr; }

//结账付钱后 要把住客住的房间给空出来 void delete_the_house_person(link_guest p) { int i=0;

for (i=0;i<10;i++) { if (strcmp(p->room,h[i].house_number)==0) { h[i].sum_person=0; return ; } } };

link_guest pay_for_house(link_guest head) { char str[10]; link_guest p; struct tm *pstr; float money; // printf(\结账的住客的名字:\\n\ // scanf(\ p=head; if (is_null_guest(p)) { printf(\当前没有任何住客的信息!\\n\ return head; } else { printf(\输入你想要结账客户的名字:\\t\ scanf(\ while (p->next!=NULL&&(strcmp(p->next->name,str)!=0)) { p=p->next; } if (p->next==NULL) { printf(\ printf(\没有该住客的信息!\\n\

printf(\ return head; } else { p=p->next; printf_detail_now(p); printf(\结账时间:\\t\\t\ pstr=pay_for_time(); //pay_for_house_money(pstr,p); money=pay_for_house_money(pstr,p); delete_the_house_person(p); printf(\住客应付:\\t\\t%.2f元\ printf(\ } } return head; }

void main() { int choice; link_guest head=create_guest(); do { //system(\清屏函数 printf(\酒店房间登记与计费管理系统----\\n\ printf(\登记入住\\n\ printf(\查询房间的入住情况\\n\ printf(\删除客户\\n\

printf(\查询住客\\n\

printf(\修改住客的信息:\\n\

printf(\查询所有的客房信息:\\n\

printf(\空余客房查询:\\n\// printf(\查询当前费用\\n\// printf(\结账退房\\n\

printf(\结账退房:\\n\

printf(\清空屏幕:\\n\

printf(\退出程序\\n\

printf(\

printf(\请选择:\\t\

scanf(\

printf(\

if (choice>10||choice<0) { printf(\对不起!没有这个选项 !\\n\ continue; }

switch (choice) { case 1: head=insert_guest(head); break; case 2: printf_guest(head); break; case 3: head=delete_guest(head); break;

}

case 4: lookfor_guest(head); break; case 5: head=modify_guest(head); break; case 6: // printf(\你要查询的是:1.单人间 2.双人间 3.多人间 4.退出:\\n\ // printf(\你的选择是:\\t\ // scanf(\ printf_all_house(); break; case 7: lookfor_house_is_Null(); break; case 8: pay_for_house(head); break; case 9: system(\ break; case 10: printf(\系统已退出!\\n\ exit(1); break; default: break; }

} while(choice!=10);


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

下一篇:学生顶岗实习报告范文3篇

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

马上注册会员

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