




版權(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)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 九年級歷史下冊 第一單元 殖民地人民的反抗與資本主義制度的擴(kuò)展 第2課 俄國的改革教學(xué)設(shè)計(jì)設(shè)計(jì)(pdf) 新人教版
- Unit 2 My schoolbag Part B Let's talk Let's learn大單元整體教學(xué)設(shè)計(jì)表格式-2024-2025學(xué)年人教PEP版英語四年級上冊
- 《習(xí)作:我有一個(gè)想法》教學(xué)設(shè)計(jì)-2024-2025學(xué)年統(tǒng)編版語文三年級上冊
- 6 感官總動(dòng)員 教學(xué)設(shè)計(jì)-2024-2025學(xué)年科學(xué)一年級上冊蘇教版
- 2024年九年級化學(xué)上冊 根據(jù)化學(xué)式進(jìn)行計(jì)算專題教學(xué)設(shè)計(jì) (新版)滬教版
- 2024秋九年級語文上冊 第三單元 12湖心亭看雪教學(xué)設(shè)計(jì) 新人教版
- 七年級英語下冊 Module 8 Story time Unit 1 Once upon a time….第2課時(shí)教學(xué)設(shè)計(jì)(新版)外研版
- 藍(lán)光治療護(hù)理及注意事項(xiàng)
- 27 故事二則《扁鵲治病》(教學(xué)設(shè)計(jì) )-2024-2025學(xué)年統(tǒng)編版語文四年級上冊
- 2023六年級數(shù)學(xué)上冊 三 分?jǐn)?shù)除法 分?jǐn)?shù)除法應(yīng)用題教學(xué)設(shè)計(jì) 蘇教版
- 浙江省寧波市2025屆高三數(shù)學(xué)適應(yīng)性考試二模試題
- 機(jī)械制圖基本知識
- 胸腔閉式引流護(hù)理-中華護(hù)理學(xué)會(huì)團(tuán)體標(biāo)準(zhǔn)
- 2024年中考英語復(fù)習(xí)1600詞背誦單按字母排序
- 婚內(nèi)保證書模板
- 光伏板智能清掃機(jī)器人結(jié)構(gòu)設(shè)計(jì)
- 2024年貴州省黔東南州中考文科綜合試卷
- 醫(yī)院雙活數(shù)據(jù)中心解決方案
- SF-36生活質(zhì)量調(diào)查表(SF-36-含評分細(xì)則)
- 小故事大道理兩只山羊
- 《機(jī)械基礎(chǔ)》課程標(biāo)準(zhǔn)(中職)
評論
0/150
提交評論