简易酒店管理系统代码

2019-03-10 21:04

#include #include #include #include

//时间函数的定义

struct tm *localtime(const time_t * timep);

//时间的初始化

char *wday[]={\星期天\星期一\星期二\星期三\星期四\星期五\星期六\ time_t timep; struct tm *now; struct tm *after; // time(&timep);

//酒店房间的定义 struct house { char house_number[10]; char house_shape[2]; float house_price; int sum_person; // struct house *next; }h[10]= { {\ {\ {\ {\ {\ {\ {\ {\ {\ {\};

struct guest { //住客姓名、性别、年龄、身份、身份证号码,房号,床号,入住日期、入住时间、离店日期、离店时间。 char name[10]; char sex[6]; int age; char identify[18]; char identify_number[18]; char room[10]; char bed[10]; // Date guest_in; // Date guest_out; struct tm *p; struct tm *q; struct guest *next; };

void first_inquiry() { int i=0; int n=0; char ch[2]=\ for (i=0;i<10;i++) { if ((strcmp(h[i].house_shape,ch)==0)) { if (h[i].sum_person==0) { printf(\ } } } }

void second_inquiry() { { int i=0; int n=0; char ch[2]=\

for (i=0;i<10;i++) { if ((strcmp(h[i].house_shape,ch)==0)) { if (h[i].sum_person==0) { printf(\ } } } } }

void third_inquiry() { int i=0; int n=0; char ch[2]=\ for (i=0;i<10;i++) { if ((strcmp(h[i].house_shape,ch)==0)) { if (h[i].sum_person==0) { printf(\ } } } }

void lookfor_house_is_Null() { int your_choice; do { printf(\你要查询:1.单人间 2.双人间 3.多人间 4.退出:\\n\ printf(\输入你的选择:\\t\

scanf(\ switch(your_choice) { case 1: printf(\单人间的空余房间:\\t\ first_inquiry(); printf(\ break; case 2: printf(\双人房的空余房间:\\t\ second_inquiry(); printf(\ break; case 3: printf(\多人间的空余房间:\\t\ third_inquiry(); printf(\ break; case 4: // exit(1); break; } } while(your_choice!=4); printf(\ printf(\ }

void add_house_sum_number(char str[10]) { int i=0; for (i=0;i<10;i++) { if ((strcmp(h[i].house_number,str)==0)) {

h[i].sum_person=1; } else { continue; } } }

typedef struct guest * link_guest;

//创建

link_guest create_guest(void) { link_guest head=(link_guest)malloc(sizeof(struct guest)); if (head!=NULL) { head->next=NULL; } else { printf(\ } return head; }

bool is_null_guest(link_guest head) { if(head->next==NULL) { return true; } return false; }

//写个函数判断一下 当输入住客的房号时,是否还有个这个房间 bool is_null_this_house(char str[10]) { int i=0;


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

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

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

马上注册会员

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