一个java编程问题,关于点菜浏览次数:629次悬赏分:15|处理时间:2010-1-1413:10|提问者:aimiaozi现在有一份菜单给客人察看,并要计算他们的消费。
要求:客人菜时要打印出菜单,而且只需输入菜号即点菜,并要打印出客人所点的菜,最后计算客人应付的菜钱。
编号菜名价钱01扬州炒饭5.002辣子鸡丁9.003羊肉串5.004鸡汤15.0各位高手帮帮忙吧~~~~~能做得了全部最好,谢谢!!!问题补充:程序是要输入菜号就能知道菜名、菜价,我就是不会这点。


如果可以,希望能用一维数组做出来。
我是初学者!!!!!答得好能加分哦,谢谢!!麻烦各位了,请多包涵!最佳答案packageddd;publicclassDish{privateStringname;privateStringid;privatedoubleunit;privateintnumber;privateStringtext;publicDish(Stringid,Stringname,doubleunit,intnumber){this.id=id;this.name=name;this.unit=unit;this.number=number;}publicDish(){}publicStringgetName(){returnname;}publicvoidsetName(Stringname){this.name=name;}publicStringgetId(){returnid;}publicvoidsetId(Stringid){this.id=id;}publicdoublegetUnit(){returnunit;}publicvoidsetUnit(doubleunit){this.unit=unit;}publicintgetNumber(){returnnumber;}publicvoidsetNumber(intnumber){this.number=number;}publicStringgetText(){returntext;}publicvoidsetText(Stringtext){this.text=text;}publicDishclone(){Dishd=newDish();d.setId(id);d.setName(name);d.setUnit(unit);d.setNumber(number);returnd;}}-----------------------------------------packageddd;importjava.sql.Date;importjava.text.SimpleDateFormat;importjava.util.LinkedList;importjava.util.List;publicclassOrder{privateStringuser;publicListlist;privatedoublesumMoney;privateStringdate;publicOrder(Stringuser){this.user=user;SimpleDateFormatformat=newSimpleDateFormat("yyyy-MM-ddhh:mm:ss");Datedate=newDate(System.currentTimeMillis());this.date=format.format(date);list=newLinkedList();}publicListgetList(){returnlist;}publicvoidsetList(Listlist){this.list=list;}publicdoublegetSumMoney(){returnsumMoney;}publicvoidsetSumMoney(doublesumMoney){this.s
2021/6/19 17:40:46 10KB 点餐、菜单、价格、
1
欢迎来到GitHubPages您可以使用的来维护和预览Markdown文件中网站的内容。
每当您提交到该存储库时,GitHubPages都将运行从Markdown文件中的内容重建站点中的页面。
降价促销Markdown是一种轻巧且易于使用的语法,可用于样式化您的文字。
它包括以下约定Syntaxhighlightedcodeblock#Header1##Header2###Header3-Bulleted-List1.Numbered2.List**Bold**and_Italic_and`Code`text[Link](url)and![Image](src)有关更多详细信息,请参见。
吉柯主题您的Pages网站将使用您在选择的Jekyll主题的规划和样式。
该主题的名称保存在Jekyll_conf
2022/9/5 23:49:18 1KB
1
39.99美元买的,可以看一下https://assetstore.unity.com/packages/tools/ai/emerald-ai-2-0-40199?tdsourcetag=s_pcqq_aiomsg你将要下载的是一个Text文本,外面是百度云链接-CreateAnyAI-CreateanykindofAIsuchasguards,villagers,thieves,bandits,creatures,animals,wildlife,zombies,companions,andmore.
2022/9/5 23:18:56 116B AI 僵尸 动物 射击
1
西门子S7200SmartTCP通讯节制shortre=0;stringrestr="";re=PLC.EntLink(txtLocalIP.Text.Trim(),Convert.ToUInt16(txtLocalPort.Text),txtRemoteIP.Text.Trim(),Convert.ToUInt16(txtRemotePort.Text),Convert.ToUInt16(0),Convert.ToUInt16(2),"DEMO",refHandle1);txtReLink.Text=re.ToString();if(re==0){EntLink=true;MessageBox.Show("PLC联接成功!");}else{EntLink=false;MessageBox.Show("PLC联接失败:"+restr);}
2022/9/5 10:52:43 1000KB S7 200 西门子200
1
MSCOMM和TEECHART控件在VS2010环境下的结合,可以实现数据实时传输、显示数据波形,并且可以把数据保存成text格式,方便后续分析,可用于生物医学信号数据的传输。
2022/9/4 10:03:35 42.16MB 串口通信绘图
1
压缩文件里面有两个文件夹,第一个是已经生成好的表白小程序,点里面的exe文件就可以运转,不会编程的人可以也可以改窗口中的文字和图片,改文字的直接改里面的text文档中相应的文字,要替换图片的,直接把要替换的图片拖进来,文件名要改成一样的,然后删掉原来的图片,大神忽略,纯属娱乐
2022/9/4 5:30:56 152KB 表白程序 c#
1
packagecom.frog.vote.servlet.front;importjava.io.IOException;importjava.sql.Timestamp;importjava.util.ArrayList;importjava.util.List;importjavax.servlet.ServletContext;importjavax.servlet.ServletException;importjavax.servlet.http.HttpServlet;importjavax.servlet.http.HttpServletRequest;importjavax.servlet.http.HttpServletResponse;importcom.frog.vote.bean.UserBean;importcom.frog.vote.cons.Const;importcom.frog.vote.dao.entity.Vote;importcom.frog.vote.factory.ServiceFactory;publicclassVoteServletextendsHttpServlet{ @Override protectedvoiddoGet(HttpServletRequestreq,HttpServletResponseresp) throwsServletException,IOException { doPost(req,resp); } @Override protectedvoiddoPost(HttpServletRequestreq,HttpServletResponseresp) throwsServletException,IOException { req.setCharacterEncoding("gbk"); resp.setContentType("text/html;charset=gbk"); //先取出操作参数 Stringaction=req.getParameter("action"); ServletContextapplication=getServletContext(); //显示的列表 if("show".equals(action)) { //调用service层方法得到所有的 Stringtemp=req.getParameter("page"); intpage=1; if(temp!=null) { try { page=Integer.parseInt(temp); } catch(NumberFormatExceptione) { e.printStackTrace(); } } UserBeanub=(UserBean)req.getSession().getAttribute(Const.USER); intuid=ub.getId(); req.setAttribute("page",ServiceFactory .getVoteService().listUserPage(page,uid)); application.getRequestDispatcher("/WEB-INF/front/list.jsp") .forward(req,resp); return; } elseif("save".equals(action)||"update".equals(action)) { Stringsid=req.getParameter("id"); String[]answers=req.getParameterValues("choice"); Listlist=newArrayList(); inttemp; for(Stringanswer:answers){temp=Integer.parseInt(answer);list.add(temp);} inttid=Integer.parse
2022/9/3 9:36:43 577KB jsp+servlet+mysql
1
PB新大陆星POS扫码支付源码,调用C#动态库,简单实现接口,采用POWERBUILDER9.0开发stringls_urlstringls_datastringls_ddstringls_zfqd//【交易类型--传入平台用】ifrb_1.checked=truethen ls_zfqd="WXPAY"endififrb_2.checked=truethen ls_zfqd="ALIPAY"endififrb_3.checked=truethen ls_zfqd="YLPAY"endif//【生成请求地址===从配置参数中维护请求地址的一部分】ls_url=gs_pos_requesturl+"sdkBarcodePay.json"//【判断输入金额能否符合要求】ifdec(em_1.text)<=0.00then messagebox("系统提示【MYSOFT】","所输金额不正确!~r~n请重新输入!") em_1.setfocus() returnendif//【判断商户订单号能否为空】ifsle_4.text=""then messagebox("系统提示【MYSOFT】","订单号不能为空!") returnendif//【判断能否扫描付款码】ifsle_code.text=""then messagebox("系统提示【MYSOFT】","付款码不能为空!") sle_code.setfocus() returnendif//【判断能否扫描付款码】iflen(sle_code.text)=0then messagebox("系统提示【MYSOFT】","请扫描服务对象付款码......") sle_code.setfocus() return-1endif//【判断订单号能否为空】iflen(sle_4.text)=0then messagebox("系统提示【MYSOFT】","订单号不能为空!") sle_4.setfocus() return-1endif//【初始化伪随机数发生器,让应用程序每次运用不同的伪随机数序列。
】randomize(0)//【清除is_keys[]is_value[]】inv_wxpay.of_clear()//====================生成公共请求参数==============================================================//【操作系统:3-直连】inv_wxpay.of_add_pos("opSys","3")//【字符集:00-GBK】inv_wxpay.of_add_pos("characterSet","00")//【机构号,从配置参数维护】inv_wxpay.of_add_pos("orgNo",gs_pos_orgno)//【商户号,从配置参数维护】inv_wxpay.of_add_pos("mercId",gs_pos_mercid)//【设备号,从配置参数维护】inv_wxpay.of_add_pos("trmNo",gs_pos_trmno)//【商户单号,不能重复,若重复则返回:数据库错误】inv_wxpay.of_add_pos("tradeNo",sle_4.text)//【设备端交易时间:yyyymmddhhmmss】inv_wxpay.of_add_pos("txnTime",string(now(),"yyyymmddhhmmss"))//【签名方式:MD5】inv_wxpay.of_add_pos("signType","MD5")//【版本号:默认V1.0.0】inv_wxpay.of_add_pos("version","V1.0.0")//==================生成商户主扫请求参数============================================================//【实付金额:分为单位】inv_wxpay.of_add_pos("amount",string(long(dec(em_1.text)*100)))//【订单总金额:分为单位】inv_wxpay.of_add_pos("total_amount",string(long(dec(em_1.text)*100)))//【扫码支付授权码】inv_wxpay.of_add_pos("authCode"
2015/6/24 6:08:54 11.64MB PB POWERBUILDER
1
//压缩前数据TextField_get.text=@service=\alipay.fund.stdtrustee.order.create.pay\&partner=\2088401309894080\&_input_charset=\utf-8\¬ify_url=\https://wwhongbao.taobao.com/callback/alipay/notifyPaySuccess.do\&out_order_no=\23743001583595538_8daa2b6a58da7263bd4140857b561a19_2\&out_request_n
2016/2/6 22:47:55 35KB 支付宝 方法 调用
1
1.直接上最简单的一种ajax异步上传图片,并预览html:<!DOCTYPEhtml><html><head><metahttp-equiv="Content-Type"content="text/html;charset=UTF-8"><title>图片上传|cookie</title></head><body>file:<inputtype="file"id="images"name="image"/>desc:<inputtype="text"id="desc"name="desc"/><br
2018/1/6 14:43:32 35KB ajax 传照片 图片
1
共 219 条记录 首页 上一页 下一页 尾页
在日常工作中,钉钉打卡成了我生活中不可或缺的一部分。然而,有时候这个看似简单的任务却给我带来了不少烦恼。 每天早晚,我总是得牢记打开钉钉应用,点击"工作台",再找到"考勤打卡"进行签到。有时候因为工作忙碌,会忘记打卡,导致考勤异常,影响当月的工作评价。而且,由于我使用的是苹果手机,有时候系统更新后,钉钉的某些功能会出现异常,使得打卡变得更加麻烦。 另外,我的家人使用的是安卓手机,他们也经常抱怨钉钉打卡的繁琐。尤其是对于那些不太熟悉手机操作的长辈来说,每次打卡都是一次挑战。他们总是担心自己会操作失误,导致打卡失败。 为了解决这些烦恼,我开始思考是否可以通过编写一个全自动化脚本来实现钉钉打卡。经过一段时间的摸索和学习,我终于成功编写出了一个适用于苹果和安卓系统的钉钉打卡脚本。
2024-04-09 15:03 15KB 钉钉 钉钉打卡