餐廳點(diǎn)菜系統(tǒng) 設(shè)計(jì)說明書_第1頁
餐廳點(diǎn)菜系統(tǒng) 設(shè)計(jì)說明書_第2頁
餐廳點(diǎn)菜系統(tǒng) 設(shè)計(jì)說明書_第3頁
餐廳點(diǎn)菜系統(tǒng) 設(shè)計(jì)說明書_第4頁
餐廳點(diǎn)菜系統(tǒng) 設(shè)計(jì)說明書_第5頁
已閱讀5頁,還剩15頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

C++語言程序設(shè)計(jì)課程設(shè)計(jì)說明書一、課程設(shè)計(jì)題目及功能簡介2:3304餐廳點(diǎn)菜系統(tǒng)背景及實(shí)用性115267三、“餐廳點(diǎn)菜系統(tǒng)”流程圖點(diǎn)菜點(diǎn)餐四、“餐廳點(diǎn)菜系統(tǒng)”模板介紹342c++#"customer.h"classManage{private:int*Desk_ptr;Food*Food_ptr;Customer*Customer_ptr;intAll_Desk_num;intDesk_customer;每桌客人數(shù)intDesk_num_ing;int所需餐桌數(shù)intchoice;public:Manage(){}intDesk,intCust);~Manage();};intDesk,intCust){inti;(Customer_ptr+i)->Set_Desk_number(0);}Desk_customer=Cust;}Manage::~Manage(){[]Desk_ptr;deleteFood_ptr;}voidManage::Give_Desk(intcust_num){inti,j;inttemp;temp=(cust_num%Desk_customer);(temp==0)desk_num=(cust_num/Desk_customer);else{(temp==cust_num)desk_num=1;elsedesk_num=(cust_num/Desk_customer)+1;}cout<<"您需要餐桌數(shù)為<<desk_num<<"張<<endl;for(i=0;i<desk_num;i++){for(j=0;j<All_Desk_num;j++){((Customer_ptr+j)->Give_Desk_num()==0){Desk_num_ing=j;(Customer_ptr+j)->Set_Desk_number(j+1);;}}}cout<<"餐桌預(yù)訂成功!"<<endl;}{cout<<"請問你是:"<<endl;cout<<"1、用戶"<<endl;cout<<"2、普通用戶"<<endl;cout<<"3、退出"<<endl;cin>>choice;switch(choice){case1:(Customer_ptr+Desk_num_ing)->Set_Type("普通用戶");;:Manage::~Manage();exit(1);}}switch(choice){case1:Food_ptr=newBreakfast();Food_ptr=newLunch();(Customer_ptr+Desk_num_ing)->Set_Food(Food_ptr);;case3:(Customer_ptr+Desk_num_ing)->Set_Food(Food_ptr);;default:Manage::~Manage();exit(1);}}{(desk_num>1){cout<<"輸入您需要的";(Customer_ptr+Desk_num_ing)->Show_food_type();cout<<"份數(shù)<<endl;cin>>n;(Customer_ptr+Desk_num_ing)->Set_food_num(n);}}voidManage::Show_Menu(){cout<<"您一共訂了""張餐桌!"<<endl;voidManage::Pay(){intdesk_number;usingnamespacestd;floatFood_Price;virtualfloatGet_price(){}"<<endl;}};classpublicFood{public:Breakfast(){egg.Food_Name="雞蛋",egg.Food_Price=1;"牛奶",milk.Food_Price=2;soybean_milk.Food_Name="豆?jié){",soybean_milk.Food_Price=1;"饅頭",steamed_bread.Food_Price=0.5;youtiao.Food_Name="油條",youtiao.Food_Price=0.5;"春卷",chunjuan.Food_Price=1.5;B[1]=milk;B[5]=chunjuan;}for(j=0;i<6;j++){a[j]=i;cin>>i;}}(a[k]==t){returnall_price1;}B[a].Show_Food();}Foodmilk;intj;inta[20];FoodB[6];};classpublicFood{eggplant.Food_Name="紅燒茄子",eggplant.Food_Price=4;potato.Food_Name="土豆絲",potato.Food_Price=4;cabbage_soup.Food_Name="白菜清湯",cabbage_soup.Food_Price=2.5;toufu_soup.Food_Name="豆腐清湯",toufu_soup.Food_Price=2.5;"青椒肉絲",pepper.Food_Price=9;fish.Food_Name="酸菜魚",fish.Food_Price=9;chicken.Food_Name="辣子雞",chicken.Food_Price=10;duck.Food_Name="水煮鴨",duck.Food_Price=10;"干巴牛肉",beef.Food_Price=12;prawn.Food_Name="油炸海蝦",prawn.Food_Price=10;food_type2="午餐";all_price2=0.0;C[0]=eggplant;C[6]=chicken;C[7]=duck;C[8]=beef;C[9]=prawn;}for(j2=0;i2<10;j2++){b[j2]=i2;cin>>i2;}}virtualstringGet_food_type(){returnfood_type2;}virtualfloatGet_price(){for(intk=0;k<j2;k++)for(intt=0;t<10;t++)(b[k]==t){}virtualvoidShow_Food(){for(inta=0;a<j2;a++)C[a].Show_Food();}Foodbeef;intj2;intb[20];FoodC[10];};food.h文件public:Dinner(){"涼拌黃瓜",cucumber.Food_Price=5;all_price3=0.0;D[0]=cucumber;D[1]=cabbage;D[2]=Fish;D[3]=douya;D[4]=donggua;;D[5]=zhusun;D[6]=haidai_soup;D[7]=zicai_soup;}virtualvoidchoosefood(){for(j3=0;i3<8;j3++){c[j3]=i3;cin>>i3;}}virtualstringGet_food_type(){returnfood_type3;}virtualfloatGet_price(){for(intk=0;k<j3;k++)for(intt=0;t<8;t++)(c[k]==t){all_price3+=D[t].Food_Price;;}private:Foodcucumber;Foodcabbage;FoodFish;};{private:int桌號Food*Cust_Food_Ptr;public:voidintnum){Desk_number=num;}設(shè)置桌號voidSet_Food(Food*p){Cust_Food_Ptr=p;Cust_Food_Ptr->choosefood();}設(shè)置餐點(diǎn)類型cout<<"您的號碼為:<<Desk_number<<"號<<endl;cout<<"您的菜單為:"<<endl;Cust_Food_Ptr->Show_Food();}voidCut_Bill(){(Cust_type==用戶")cout<<"尊敬的VIP用戶,您總共消費(fèi)<<(Cust_Food_Ptr->Get_price())*0.85*food_num<<"元"<<endl;elsecout<<"尊敬的顧客,您總共消費(fèi)<<Cust_Food_Ptr->Get_price()*food_num<<"元"<<endl;Desk_number=0;}};"manage.h"cin>>All_desknumber;(All_desknumber<15){cout<<"您的輸入錯(cuò)誤!"<<endl;return0;}{cout<<"輸入每張餐桌容納的客人數(shù);cin>>Customer_num;cout<<"初始化完畢!"<<endl;}Manage//聲明一個(gè)對象(1){intchoice=1;cout<<"餐廳管理系統(tǒng):"<<endl;cout<<"1.點(diǎn)餐結(jié)賬退出系統(tǒng)"<<endl;cout<<"請選擇;cin>>choice;switch(choice){case1:{cout<<"請輸入顧客數(shù)(顧客數(shù)不能小于人);cin>>cust_number;(cust_number<30){cout<<"您的輸入錯(cuò)誤"<<endl;return0;}{My_Manage.Give_Cust_Type();顧客類型My_Manage.Give_Desk(cust

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論