77范文网 - 专业文章范例文档资料分享平台

C++课程设计自助点餐系统(4)

来源:网络收集 时间:2019-01-26 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:或QQ: 处理(尽可能给您提供完整文档),感谢您的支持与谅解。点击这里给我发消息

cout<<\ 1:修改数量 |\ cout<<\ 2:删除食物 |\ cout<<\ 3:退出修改 |\ cout<<\ int next; cin>>next; return next; }

Main.cpp

#include #include\

#include\#include\#include\#include\#include #include using namespace std; int main() { FeeManager feem;//管理就餐和外卖的费用 MenuView mv; //管理界面 ClientManager cm; //管理客户的类的对象 FoodManager fm;//管理食物的类的对象 fstream ioFile; //文件输入输出 int clientChoice;// 1 服务顾客 2 食物管理 3 今日反馈 4退出系统 int clientService;//1新顾客点餐 2 查询 int mainChoice;// 1 就餐 2 外卖 int curClient; //当前操作的顾客编号 int queryChoice;//1 查询订单 2 退出查询 int foodChoice;//1 添加食物 2 修改食物价格 3删除某种食物 4退出食物管理 int viewChoice;//1 顾客服务 2 食物管理 3 今日反馈 4 退出系统 int menuChoice;//1 原菜单 2 更新后菜单 int mendDingDanChoice;//1 修改数量 2 删除食物 3 退出修改 ioFile.open(\ while(!ioFile.eof()) { char *s; double p; s=new char[20]; ioFile>>s>>p; fm.addFood(s,p); } ioFile.close();

//以上是从文件读入食物的种类和价格信息 while(true){

viewChoice = mv.showViewChoice(); if(viewChoice == 1) //顾客服务 { clientService = mv.showRegister(); if(clientService == 1)//用户注册 { char *name,*phone; name = new char[30]; phone = new char[20]; cout<<\请完善客户资料\ cout<<\您的订单号是\ curClient = cm.getClientNum(); cout<<\请输入姓名: \ cout<<\请输入手机号码: \ Client cc(name,phone); cc.setNumber(cm.getClientNum()); cm.addClient(cc);

mainChoice = mv.showMain(); if(mainChoice == 1) //就餐 { cm.client[curClient].setType(1); mv.showJiuCan(); while(true) { fm.showFood(); int choices; choices = mv.showClientChoice(); if(choices==1)//选择食物种类和数量,下单 { char *n; int code; n = new char[20]; int nums; double prices ; cout<<\请输入食物编号: \ n = fm.food[code].getName(); cout<<\您选择了食物: \ prices = fm.getPriceByName(n); cout<<\请输入数量: \ cm.client[curClient].client_fm.addFood(Food(n,prices)); cm.client[curClient].addFee(nums*prices);

cm.client[curClient].num[cm.client[curClient].client_fm.getTotal()-1]=nums; cout<<\当前的总费用是\ } else if(choices == 2)//修改订单 { cout<<\您当前的订单是:\ while(true){ cm.client[curClient].showClientMessage(); mendDingDanChoice = mv.showMendDingDan(); if(mendDingDanChoice==1) { cm.client[curClient].changNum(); } else if(mendDingDanChoice == 2) { cm.client[curClient].deleFood(); } else if(mendDingDanChoice == 3)break; } } else if(choices == 3)//提交订单 break; } feem.addJiuCanFee(cm.client[curClient].getFee());//增加就餐总费用 cout<<\您的订单是:\ cm.client[curClient].showClientMessage();//输出当前订单 } else if(mainChoice == 2) //外卖 { cm.client[curClient].setType(2); mv.showJiuCan(); while(true) { fm.showFood(); int choices; choices = mv.showClientChoice(); if(choices==1)//选择食物种类和数量,下单 { char *n; int code;

n = new char[20]; int nums; double prices ; cout<<\请输入食物编号: \ n = fm.food[code].getName(); cout<<\您选择了食物: \ prices = fm.getPriceByName(n); cout<<\请输入数量: \ cm.client[curClient].client_fm.addFood(Food(n,prices)); cm.client[curClient].addFee(nums*prices); cm.client[curClient].num[cm.client[curClient].client_fm.getTotal()-1]=nums; cout<<\当前的总费用是\ } else if(choices == 2)//修改订单 { cout<<\您当前的订单是:\ while(true){ cm.client[curClient].showClientMessage(); mendDingDanChoice = mv.showMendDingDan(); if(mendDingDanChoice==1) { cm.client[curClient].changNum(); } else if(mendDingDanChoice == 2) { cm.client[curClient].deleFood(); } else if(mendDingDanChoice == 3)break; } } else if(choices == 3)//提交订单 break; } feem.addWaiMaiFee(cm.client[curClient].getFee());//增加就餐总费用 cout<<\您的订单是:\ cm.client[curClient].showClientMessage();//输出当前订单 } }//用户注册 else if(clientService == 2)

{ while(true) { queryChoice = mv.showQuery(); if(queryChoice == 1) //查询客户订单信息 { cout<<\请输入您的姓名:\ char *s; s = new char[20]; cin>>s; cm.showQuery(s); } else if(queryChoice == 2)break; //退出查询 } } }

else if(viewChoice == 2) //食物管理 { while(true) { fm.showFood(); foodChoice = mv.showMend(); if(foodChoice == 1) //添加食物 { char *n; double p; n = new char[20]; cout<<\请输入食物名称: \ cout<<\请输入食物价格: \ fm.addFood(Food(n,p)); } else if(foodChoice == 2)//修改食物价格 { fm.changePrice(); } else if(foodChoice == 3)//删除食物 { fm.deleteFood(); } else if(foodChoice == 4)break; //退出食物管理 } }

百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库C++课程设计自助点餐系统(4)在线全文阅读。

C++课程设计自助点餐系统(4).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印 下载失败或者文档不完整,请联系客服人员解决!
本文链接:https://www.77cn.com.cn/wenku/zonghe/448658.html(转载请注明文章来源)
Copyright © 2008-2022 免费范文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ: 邮箱:tiandhx2@hotmail.com
苏ICP备16052595号-18
× 注册会员免费下载(下载后可以自由复制和排版)
注册会员下载
全站内容免费自由复制
注册会员下载
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: