当前位置: 首页 > news >正文 北仑网站制作买个网站需要多少钱 news 2025/10/25 18:20:02 北仑网站制作,买个网站需要多少钱,专业网吧装修设计公司,赤峰网站制作公司在写这篇文章的时候#xff0c;我也不清楚自己能不能写好,但是想了想还是写一下吧#xff0c;就当是为前面所学的东西做一下总结。 首先我们要清楚这个程序所需要的东西#xff0c;第一件就是先定义数组#xff0c;为数组定义一些元素#xff0c;从而来实现数组中元素的使…在写这篇文章的时候我也不清楚自己能不能写好,但是想了想还是写一下吧就当是为前面所学的东西做一下总结。 首先我们要清楚这个程序所需要的东西第一件就是先定义数组为数组定义一些元素从而来实现数组中元素的使用。这里我定义了很多数组代码如下 String[] name new String[4]; //定义一个定餐人姓名的数组String[] dishMegs new String[4]; //这个是订餐的菜名int[] time new int[4]; //订餐人所定的时间String[] addresses new String[4]; //订餐地址int[] states new int[4]; //这里用了一个int数组来表示是否签收double[] sumPrices new double[4]; //订餐的总价格double[] Prices new double[4]; /这个是餐品的单价为多少String[] menu new String[4]; //这个是菜名int[] dz new int[4]; //定义点赞的数组 这样我们的第部就完成了接下来我们往数组里放元素这个根据自己的要求来放 因为定义的数组长度都为4所以我们放的元素不能越界 menu[0] 红烧带鱼; //往菜单里面添加元素menu[1] 鱼香肉丝;menu[2] 时令鲜蔬;//桑拼单价Prices[0] 38.0;Prices[1] 20.0;Prices[2] 10.0;//点赞数为dz[0] 0;dz[1] 0;dz[2] 0;// 第一条订单信息name[0] 张晴;dishMegs[0] 红烧带鱼两份;time[0] 12;addresses[0] 天成路207号;sumPrices[0] 76.0;states[0] 1;//第二条订单信息name[1] 张晴;dishMegs[1] 鱼香肉丝两份;time[1] 18;addresses[1] 天成路207号;sumPrices[1] 45.0;states[1] 0; 因为要输出来一些程序的选项我们用do ,whlie循环来写这个首先我们先定义一个Boolean变量初始值为false在我们在程序想退出时按规定的按钮让他能够跳出循环这样我们就能够实现外部内容 boolean isadd false; int num0; do{System.out.println(1.我要订餐);System.out.println(2.查看钱袋);System.out.println(3.签收订单);System.out.println(4.删除订单);System.out.println(5.我要点赞);System.out.println(6.退出系统);System.out.println(***************************);boolean isExit false;System.out.print(请选择);int choose input.nextInt(); //定义一个变量把他当成开关switch (choose) {case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:isExit true;break;if(!isExit){System.out.print(输入0返回);num input.nextInt();}else{break; }}}while(num0) 这样我们完成里系统的外部剩下的按钮就是用switch来完成了 我们首先要明白这个内容所需要的东西我们先定义一个变量然后将所写的内容加到我们最开始定义的数组中 case 1中我们定定义的就是内容将上面定义的isadd作为一个是否能增加餐袋的按钮如果还有空的餐袋我们就能够输入否则输出餐袋已经满了的标识 case 1://创建1.按钮实现里面的内容System.out.println(***我要订餐***);for (int i 0; i name.length; i) {if (name[i] null) {isadd true;System.out.print(请输入订餐人信息);name[i] input.next();System.out.println(序号\t菜名\t单价\t点赞数);for (int j 0; j name.length; j) {if (menu[j] null) {break;}System.out.println((j 1) \t menu[j] \t Prices[j] \t dz[i]);}System.out.print(请选择您要点的菜品编号);double bianhao input.nextDouble();System.out.print(请输入您要的份数);int number input.nextInt();System.out.print(请输入送餐时间(送餐时间是10点至20点间整点送));int time1 input.nextInt();while (!(time1 9 || time1 20)) {System.out.print(请重新输入送餐时间(送餐时间是10点至20点间整点送):);time1 input.nextInt();}double sum number * Prices[(int) (bianhao - 1)];int psf 0;int sum2 0;if (!(sum 50)) {psf 5;sum2 (int) sum 5;}System.out.print(请输入送餐地址:);addresses[i] input.next();System.out.println();//订单成功System.out.println(订餐成功);System.out.println(您定的是 menu[(int) bianhao - 1] number 份);System.out.println(送餐时间是 time1 点);System.out.println(配送地址是 addresses[i]);System.out.println(餐费 sum 元配送费是 psf 元总计 sum2);dishMegs[i] menu[(int) bianhao - 1] number 份;sumPrices[i] sum2;time[i] time1;states[i] 0;break;}}if (!isadd) {System.out.println(对不起您的餐袋已满);}break; case 2:中就是对餐袋的查看我们用一个for循环来遍历输出来这些东西 case 2:System.out.println(***查看餐袋***);System.out.println(序号\t订餐人\t餐品信息\t送餐时间\t送餐地址\t总金额\t订单状态);for (int i 0; i name.length; i) {if (name[i] ! null) {String state (states[i] 0) ? 已预订 : 已完成;System.out.println((i 1) \t name[i] \t dishMegs[i] \t time[i] \t addresses[i] \t sumPrices[i] \t state);}} case 3我们要调用里面的元素利用我们定义的states[]来判断这个订单是否完成如果是预订单没有签收那么就把states[]改成1这样就把该订单签收了同时定义一个Boolean变量如果从for循环里面找到了这个我们所选序号的订单我们就能够判断这个订单是否签收这样就能完成判段了 case 3:System.out.println(***签收订单***);System.out.print(请输入订单序号);int xuhao input.nextInt();boolean isacc false;for (int i 0; i name.length; i) {if (name ! null states[i] 0 i xuhao - 1) {states[i] 1;System.out.println(签收成功);isacc true;break;}if (name ! null states[i] 1 i xuhao - 1) {System.out.println(无法签收该订单已被签收);isacc true;break;}}if (!isacc) {System.out.println(找不到此订单);}break; case 4:中我们要能够找到这个程序符合我们所选的如果这个订单已被签收那么我们就可以将它删除如果订单没有签收我们就不能将他删减被删掉的订单数组用下一个订单来补将最后一个订单设置为空 case 4:System.out.println(***删除订单***);boolean isASS false;System.out.print(请选择要删除的订单);int ddh input.nextInt();int index -1;for (int i 0; i name.length; i) {if (name[i] ! null states[i] 0 i ddh - 1) {isASS true;System.out.println(该订单没签收无法删除);break;}if (name[i] ! null states[i] 1 i ddh - 1) {isASS true;index i;for (int j index; j name.length - 1; j) {name[j] name[j 1];addresses[j] addresses[j 1];time[j] time[j 1];states[j] states[j 1];dishMegs[j] dishMegs[j 1];sumPrices[j] sumPrices[j 1];}name[name.length-1]null;addresses[addresses.length-1] null;time[time.length-1]0;System.out.println(删除成功);break;}}if (!isASS) {System.out.println(没找到该订单);break;}break; case 5:就是点赞商品了我们首先调用出来菜单中的元素(如果点赞数为零我们不显示否则我们输出来个数为多少) case 5:System.out.println(***我要点赞***);int isAqq 0;System.out.println(序号\t菜名\t\t单价\t\t点赞数);for (int i 0; i menu.length; i) {if (menu[i] null) {break;}String dzs dz[i] 0 ? dz[i] 赞 : ;System.out.println((i 1) \t menu[i] \t Prices[i] 元\t dzs);}System.out.print(请输入商品序号);int dzh input.nextInt();dz[dzh - 1];System.out.println(点赞成功);break; 这样这个系统就完成了整体代码如下 package project;import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;import java.util.Scanner;public class OrderingMgr {public static void main(String[] args) {String[] name new String[4];String[] dishMegs new String[4];int[] time new int[4];String[] addresses new String[4];int[] states new int[4];double[] sumPrices new double[4];double[] Prices new double[4];String[] menu new String[4];int[] dz new int[4];//菜单为menu[0] 红烧带鱼;menu[1] 鱼香肉丝;menu[2] 时令鲜蔬;//桑拼单价Prices[0] 38.0;Prices[1] 20.0;Prices[2] 10.0;//点赞数为dz[0] 0;dz[1] 0;dz[2] 0;// 第一条订单信息name[0] 张晴;dishMegs[0] 红烧带鱼两份;time[0] 12;addresses[0] 天成路207号;sumPrices[0] 76.0;states[0] 1;//第二条订单信息name[1] 张晴;dishMegs[1] 鱼香肉丝两份;time[1] 18;addresses[1] 天成路207号;sumPrices[1] 45.0;states[1] 0;//int num -1;boolean isadd false;Scanner input new Scanner(System.in);System.out.println(欢迎使用“吃货联盟订餐系统”);System.out.println(***************************);do {System.out.println(1.我要订餐);System.out.println(2.查看钱袋);System.out.println(3.签收订单);System.out.println(4.删除订单);System.out.println(5.我要点赞);System.out.println(6.退出系统);System.out.println(***************************);boolean isExit false;System.out.print(请选择);int choose input.nextInt();switch (choose) {case 1://创建1.按钮实现里面的内容System.out.println(***我要订餐***);for (int i 0; i name.length; i) {if (name[i] null) {isadd true;System.out.print(请输入订餐人信息);name[i] input.next();System.out.println(序号\t菜名\t单价\t点赞数);for (int j 0; j name.length; j) {if (menu[j] null) {break;}System.out.println((j 1) \t menu[j] \t Prices[j] \t dz[i]);}System.out.print(请选择您要点的菜品编号);double bianhao input.nextDouble();System.out.print(请输入您要的份数);int number input.nextInt();System.out.print(请输入送餐时间(送餐时间是10点至20点间整点送));int time1 input.nextInt();while (!(time1 9 || time1 20)) {System.out.print(请重新输入送餐时间(送餐时间是10点至20点间整点送):);time1 input.nextInt();}double sum number * Prices[(int) (bianhao - 1)];int psf 0;int sum2 0;if (!(sum 50)) {psf 5;sum2 (int) sum 5;}System.out.print(请输入送餐地址:);addresses[i] input.next();System.out.println();//订单成功System.out.println(订餐成功);System.out.println(您定的是 menu[(int) bianhao - 1] number 份);System.out.println(送餐时间是 time1 点);System.out.println(配送地址是 addresses[i]);System.out.println(餐费 sum 元配送费是 psf 元总计 sum2);dishMegs[i] menu[(int) bianhao - 1] number 份;sumPrices[i] sum2;time[i] time1;states[i] 0;break;}}if (!isadd) {System.out.println(对不起您的餐袋已满);}break;case 2:System.out.println(***查看餐袋***);System.out.println(序号\t订餐人\t餐品信息\t送餐时间\t送餐地址\t总金额\t订单状态);for (int i 0; i name.length; i) {if (name[i] ! null) {String state (states[i] 0) ? 已预订 : 已完成;System.out.println((i 1) \t name[i] \t dishMegs[i] \t time[i] \t addresses[i] \t sumPrices[i] \t state);}}break;case 3:System.out.println(***签收订单***);System.out.print(请输入订单序号);int xuhao input.nextInt();boolean isacc false;for (int i 0; i name.length; i) {if (name ! null states[i] 0 i xuhao - 1) {states[i] 1;System.out.println(签收成功);isacc true;break;}if (name ! null states[i] 1 i xuhao - 1) {System.out.println(无法签收该订单已被签收);isacc true;break;}}if (!isacc) {System.out.println(找不到此订单);}break;case 4:System.out.println(***删除订单***);boolean isASS false;System.out.print(请选择要删除的订单);int ddh input.nextInt();int index -1;for (int i 0; i name.length; i) {if (name[i] ! null states[i] 0 i ddh - 1) {isASS true;System.out.println(该订单没签收无法删除);break;}if (name[i] ! null states[i] 1 i ddh - 1) {isASS true;index i;for (int j index; j name.length - 1; j) {name[j] name[j 1];addresses[j] addresses[j 1];time[j] time[j 1];states[j] states[j 1];dishMegs[j] dishMegs[j 1];sumPrices[j] sumPrices[j 1];}name[name.length-1]null;addresses[addresses.length-1] null;time[time.length-1]0;System.out.println(删除成功);break;}}if (!isASS) {System.out.println(没找到该订单);break;}break;case 5:System.out.println(***我要点赞***);int isAqq 0;System.out.println(序号\t菜名\t\t单价\t\t点赞数);for (int i 0; i menu.length; i) {if (menu[i] null) {break;}String dzs dz[i] 0 ? dz[i] 赞 : ;System.out.println((i 1) \t menu[i] \t Prices[i] 元\t dzs);}System.out.print(请输入商品序号);int dzh input.nextInt();dz[dzh - 1];System.out.println(点赞成功);break;case 6:isExit true;break;default:isExit true;break;}if (!isExit) {System.out.print(输入0返回);num input.nextInt();} else {break;}} while (num 0);} }刚学习java有可能写的代码有漏洞或者bug众多希望能帮助到大家如果有错误请大佬提出来一起学习 文章转载自: http://www.morning.llqch.cn.gov.cn.llqch.cn http://www.morning.ctsjq.cn.gov.cn.ctsjq.cn http://www.morning.xwzsq.cn.gov.cn.xwzsq.cn http://www.morning.tqsmg.cn.gov.cn.tqsmg.cn http://www.morning.trjr.cn.gov.cn.trjr.cn http://www.morning.lwqst.cn.gov.cn.lwqst.cn http://www.morning.ryxbz.cn.gov.cn.ryxbz.cn http://www.morning.cfnsn.cn.gov.cn.cfnsn.cn http://www.morning.qzpqp.cn.gov.cn.qzpqp.cn http://www.morning.ldhbs.cn.gov.cn.ldhbs.cn http://www.morning.bpmfq.cn.gov.cn.bpmfq.cn http://www.morning.bkkgt.cn.gov.cn.bkkgt.cn http://www.morning.c7512.cn.gov.cn.c7512.cn http://www.morning.bmjfp.cn.gov.cn.bmjfp.cn http://www.morning.qhnmj.cn.gov.cn.qhnmj.cn http://www.morning.kpbq.cn.gov.cn.kpbq.cn http://www.morning.nkrmh.cn.gov.cn.nkrmh.cn http://www.morning.zqfjn.cn.gov.cn.zqfjn.cn http://www.morning.nngq.cn.gov.cn.nngq.cn http://www.morning.hbkkc.cn.gov.cn.hbkkc.cn http://www.morning.nnhfz.cn.gov.cn.nnhfz.cn http://www.morning.hkcjx.cn.gov.cn.hkcjx.cn http://www.morning.drkk.cn.gov.cn.drkk.cn http://www.morning.pjjkz.cn.gov.cn.pjjkz.cn http://www.morning.jwtjf.cn.gov.cn.jwtjf.cn http://www.morning.fksdd.cn.gov.cn.fksdd.cn http://www.morning.hnkkm.cn.gov.cn.hnkkm.cn http://www.morning.pqjpw.cn.gov.cn.pqjpw.cn http://www.morning.mldrd.cn.gov.cn.mldrd.cn http://www.morning.cpljq.cn.gov.cn.cpljq.cn http://www.morning.ndxmn.cn.gov.cn.ndxmn.cn http://www.morning.rrcxs.cn.gov.cn.rrcxs.cn http://www.morning.kwqqs.cn.gov.cn.kwqqs.cn http://www.morning.nnwpz.cn.gov.cn.nnwpz.cn http://www.morning.fkflc.cn.gov.cn.fkflc.cn http://www.morning.hqbnx.cn.gov.cn.hqbnx.cn http://www.morning.tgtsg.cn.gov.cn.tgtsg.cn http://www.morning.tkcct.cn.gov.cn.tkcct.cn http://www.morning.joinyun.com.gov.cn.joinyun.com http://www.morning.tqhpt.cn.gov.cn.tqhpt.cn http://www.morning.mqffm.cn.gov.cn.mqffm.cn http://www.morning.vuref.cn.gov.cn.vuref.cn http://www.morning.rkgyx.cn.gov.cn.rkgyx.cn http://www.morning.fwrr.cn.gov.cn.fwrr.cn http://www.morning.rrwgh.cn.gov.cn.rrwgh.cn http://www.morning.bfrsr.cn.gov.cn.bfrsr.cn http://www.morning.qzpkr.cn.gov.cn.qzpkr.cn http://www.morning.roymf.cn.gov.cn.roymf.cn http://www.morning.drytb.cn.gov.cn.drytb.cn http://www.morning.rkkpr.cn.gov.cn.rkkpr.cn http://www.morning.dtcsp.cn.gov.cn.dtcsp.cn http://www.morning.krhkb.cn.gov.cn.krhkb.cn http://www.morning.ljngm.cn.gov.cn.ljngm.cn http://www.morning.gqwpl.cn.gov.cn.gqwpl.cn http://www.morning.smdkk.cn.gov.cn.smdkk.cn http://www.morning.kxltf.cn.gov.cn.kxltf.cn http://www.morning.lqjlg.cn.gov.cn.lqjlg.cn http://www.morning.rbgwj.cn.gov.cn.rbgwj.cn http://www.morning.yzygj.cn.gov.cn.yzygj.cn http://www.morning.clndl.cn.gov.cn.clndl.cn http://www.morning.wypyl.cn.gov.cn.wypyl.cn http://www.morning.mdrnn.cn.gov.cn.mdrnn.cn http://www.morning.jcjgh.cn.gov.cn.jcjgh.cn http://www.morning.fldk.cn.gov.cn.fldk.cn http://www.morning.dhckp.cn.gov.cn.dhckp.cn http://www.morning.ylrxd.cn.gov.cn.ylrxd.cn http://www.morning.wrwcf.cn.gov.cn.wrwcf.cn http://www.morning.drnjn.cn.gov.cn.drnjn.cn http://www.morning.hbnwr.cn.gov.cn.hbnwr.cn http://www.morning.fkfyn.cn.gov.cn.fkfyn.cn http://www.morning.pxspq.cn.gov.cn.pxspq.cn http://www.morning.fnlnp.cn.gov.cn.fnlnp.cn http://www.morning.zlnf.cn.gov.cn.zlnf.cn http://www.morning.plkrl.cn.gov.cn.plkrl.cn http://www.morning.ykwqz.cn.gov.cn.ykwqz.cn http://www.morning.trffl.cn.gov.cn.trffl.cn http://www.morning.mrxqd.cn.gov.cn.mrxqd.cn http://www.morning.plkrl.cn.gov.cn.plkrl.cn http://www.morning.dfndz.cn.gov.cn.dfndz.cn http://www.morning.tbwsl.cn.gov.cn.tbwsl.cn 查看全文 http://www.tj-hxxt.cn/news/248850.html 相关文章: 取名字网站如何做彩票做的最好是个网站好 cfa一级看多久两分钟西安seo学院 邯郸哪里可以学建网站wordpress 本地数据库 做哪类网站没有版权问题如何做新网站保留域名 外贸公司域名哪个网站申请比较好思茅网站建设 数学建模代做网站feed wordpress 购物网站项目经验一家网站建设公司需要什么资质 信息查询类网站是怎么做的网页电商设计 上海松江做网站做网站上传图片 宜昌做网站上海跨境电商网站开发公司排名 制作个简单公司网站要多少钱建设网站 洛阳 网站建设公司36氪国外做网站 东莞做网站seo优化html5毕业设计作品 评价一个网站的好坏购物网站建设实战教程答案 浦口区网站建设网站的制作方案 长沙的互联网网站公司哪家好门户网站建设招投标 免费团购网站模板营销型网站建设试题 新手学做网站12天婴wordpress模版seo 网站框架地图怎么创作自己的网站 哈尔滨网站空间网站有域名怎么和做的网页链接 google 网站 提交在线设计平台怎么运营 手机上传视频网站开发营销自己的网站 企业网站的页面信息该如何排放宁德市房价 网站建设欲网站维护加速wordpress 插件 郑州公司网站平台建设做商城网站可以个人备案 中国工程建设标准化网站报名网站建设 贵州建网站报价wordpress插件去除google 做美食教程的网站有哪些个人网页设计与制作研究背景 制作外贸网站的公司简介做网站范本 罗湖附近公司做网站建设哪家技术好海口网站建设方案咨询