




版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
C++語言程序設計課程設計說明書一、課程設計題目及功能簡介2:3304餐廳點菜系統背景及實用性115267三、“餐廳點菜系統”流程圖點菜點餐四、“餐廳點菜系統”模板介紹342c++#"customer.h"classManage{private:int*Desk_ptr;Food*Food_ptr;Customer*Customer_ptr;intAll_Desk_num;intDesk_customer;每桌客人數intDesk_num_ing;int所需餐桌數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<<"您需要餐桌數為<<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<<"餐桌預訂成功!"<<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<<"份數<<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="豆漿",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;}設置桌號voidSet_Food(Food*p){Cust_Food_Ptr=p;Cust_Food_Ptr->choosefood();}設置餐點類型cout<<"您的號碼為:<<Desk_number<<"號<<endl;cout<<"您的菜單為:"<<endl;Cust_Food_Ptr->Show_Food();}voidCut_Bill(){(Cust_type==用戶")cout<<"尊敬的VIP用戶,您總共消費<<(Cust_Food_Ptr->Get_price())*0.85*food_num<<"元"<<endl;elsecout<<"尊敬的顧客,您總共消費<<Cust_Food_Ptr->Get_price()*food_num<<"元"<<endl;Desk_number=0;}};"manage.h"cin>>All_desknumber;(All_desknumber<15){cout<<"您的輸入錯誤!"<<endl;return0;}{cout<<"輸入每張餐桌容納的客人數;cin>>Customer_num;cout<<"初始化完畢!"<<endl;}Manage//聲明一個對象(1){intchoice=1;cout<<"餐廳管理系統:"<<endl;cout<<"1.點餐結賬退出系統"<<endl;cout<<"請選擇;cin>>choice;switch(choice){case1:{cout<<"請輸入顧客數(顧客數不能小于人);cin>>cust_number;(cust_number<30){cout<<"您的輸入錯誤"<<endl;return0;}{My_Manage.Give_Cust_Type();顧客類型My_Manage.Give_Desk(cust
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 行政效能提升的途徑與實踐試題及答案
- 重要經驗分享的試題及答案匯編
- 小吃門店招牌管理制度
- 醫院倉儲消防管理制度
- 婚宴酒席財產管理制度
- 了解嵌入式設計模式試題及答案
- 婦科診室設備管理制度
- 小區物業路政管理制度
- 夜校開堂安全管理制度
- 公司扶貧基金管理制度
- 軟件專業畢業設計
- 湖北省武漢市江夏區2025屆九年級下學期5月月考語文試卷(含答案)
- 雨棚翻新合同協議書范文
- 安徽省合肥一中2025屆高三5月回歸教材讀本
- 2024年江蘇省無錫市中考歷史真題(解析版)
- 雙方房屋使用協議書
- 投資理財保本協議書
- 2025年廣東省深圳市中考道德與法治 總復習責任意識檢測卷(含答案)
- 閱讀策略在小學英語教學中的應用
- 地西半球的國家 復習課課件-2024-2025學年七年級地理下學期(人教版2024)
- 2025年黃山旅游發展股份有限公司春季招聘75人筆試參考題庫附帶答案詳解
評論
0/150
提交評論