当前位置: 首页 > news >正文

龙岗网站设计讯息搜索关键词排行榜

龙岗网站设计讯息,搜索关键词排行榜,商业网站的相关内容,网站合同 下载案例介绍: 编写一个超市购物程序,在一家超市有牙刷、毛巾、水杯、苹果和香蕉五种商品,用户输入商品序列号进行商品购买,用户输入购买数量后计算出所需要花费的钱,一次购买结束后,需要用户输入“Y”或“N”…

案例介绍:

编写一个超市购物程序,在一家超市有牙刷、毛巾、水杯、苹果和香蕉五种商品,用户输入商品序列号进行商品购买,用户输入购买数量后计算出所需要花费的钱,一次购买结束后,需要用户输入“Y”或“N”,“Y”代表继续购买,“N”代表购物结束,此时需要计算并输出本次购物的总计花费的钱。商品价格如下表所示。

 运行结果:

 完整代码:

import java.util.Scanner;public class supermarket {public static void main(String[] args){Scanner scanner = new Scanner(System.in);double toothbrush = 8.8;//牙刷double towel = 10;//毛巾double cup = 18.8;//水杯double apple = 12.5;//苹果double banana =15.5;//香蕉System.out.println("------------黑马小商城------------");System.out.println("1.牙刷的价格为:"+toothbrush+"元");System.out.println("2.毛巾的价格为:"+towel+"元");System.out.println("3.水杯的价格为:"+cup+"元");System.out.println("4.苹果的价格为:"+apple+"元");System.out.println("5.香蕉的价格为:"+banana+"元");System.out.println("--------------------------------");int item;//购买商品序列号int count;//购买商品的数量double total = 0;//购买商品总金额String good = "商品名";String goods = "商品量词";double price = 0;String choice = "Y";do{System.out.print("请输入您需要购买商品的序列号:");item = scanner.nextInt();switch (item){   //将序列号对应的商品名、商品量词、商品价格分别赋值给good、goods、pricecase 1: good = "牙刷";    goods = "把";    price = toothbrush; break;case 2: good = "毛巾";    goods = "条";    price = towel;      break;case 3: good = "水杯";    goods = "个";    price = cup;        break;case 4: good = "苹果";    goods = "斤";    price = apple;      break;case 5: good = "香蕉";    goods = "斤";    price =banana;      break;default:item=0;//若序列号输入错误,将item赋值为0System.out.println("---------商品序列号输入错误---------");}if(item!=0) //序列号输入正确,执行if语句{   System.out.print("请输入您需要购买" + good + "的数量:");count = scanner.nextInt();total = total + count * price;System.out.println("您购买了" + good + count + goods + ",需要花费" + count * price + "元");}System.out.print("需要继续购买请输入Y,否则输入N:");choice = scanner.next();while(!choice.equals("Y")&&!choice.equals("N"))//若输入字母不为Y或N,则进入while循环{System.out.println("--------是否继续购买识别失败--------");System.out.print("需要继续购买请输入Y,否则输入N:");choice = scanner.next();}//输入"Y"循环继续,输入"N"循环退出}while(choice.equals("Y"));System.out.println("您本次购物共花费 "+total+" 元");System.out.println("期待您的下次光临!");}
}

文章转载自:
http://polyangular.rgxf.cn
http://shrivel.rgxf.cn
http://curietherapy.rgxf.cn
http://verge.rgxf.cn
http://colon.rgxf.cn
http://colourcast.rgxf.cn
http://jollier.rgxf.cn
http://vietnam.rgxf.cn
http://dysbarism.rgxf.cn
http://concretization.rgxf.cn
http://danseur.rgxf.cn
http://canvas.rgxf.cn
http://amalgam.rgxf.cn
http://kissable.rgxf.cn
http://hypophysectomy.rgxf.cn
http://asbestosis.rgxf.cn
http://ptolemaic.rgxf.cn
http://liniment.rgxf.cn
http://turtledove.rgxf.cn
http://cagey.rgxf.cn
http://hearthstone.rgxf.cn
http://sanguineous.rgxf.cn
http://dividers.rgxf.cn
http://cranberry.rgxf.cn
http://wagonette.rgxf.cn
http://octaword.rgxf.cn
http://dentes.rgxf.cn
http://boastful.rgxf.cn
http://clench.rgxf.cn
http://greenhouse.rgxf.cn
http://collectable.rgxf.cn
http://manyat.rgxf.cn
http://disgustedly.rgxf.cn
http://kurta.rgxf.cn
http://elamitish.rgxf.cn
http://overinflated.rgxf.cn
http://disorientation.rgxf.cn
http://unneutrality.rgxf.cn
http://emanuel.rgxf.cn
http://vetanda.rgxf.cn
http://navelwort.rgxf.cn
http://three.rgxf.cn
http://induplicate.rgxf.cn
http://jingler.rgxf.cn
http://scirrhoid.rgxf.cn
http://madeleine.rgxf.cn
http://coulometry.rgxf.cn
http://allelomorph.rgxf.cn
http://alleviant.rgxf.cn
http://excretive.rgxf.cn
http://missiology.rgxf.cn
http://pendent.rgxf.cn
http://nephrocardiac.rgxf.cn
http://homochromous.rgxf.cn
http://deplumation.rgxf.cn
http://francine.rgxf.cn
http://overabound.rgxf.cn
http://spirochaetal.rgxf.cn
http://crewmate.rgxf.cn
http://pindus.rgxf.cn
http://zapateado.rgxf.cn
http://silica.rgxf.cn
http://rehumidify.rgxf.cn
http://lamentably.rgxf.cn
http://vax.rgxf.cn
http://overdraft.rgxf.cn
http://dtv.rgxf.cn
http://hmd.rgxf.cn
http://trecentist.rgxf.cn
http://oe.rgxf.cn
http://whirry.rgxf.cn
http://eugenist.rgxf.cn
http://mccarthyist.rgxf.cn
http://prosthetics.rgxf.cn
http://sympathise.rgxf.cn
http://biophilosophy.rgxf.cn
http://wv.rgxf.cn
http://semidaily.rgxf.cn
http://shinleaf.rgxf.cn
http://vishnu.rgxf.cn
http://hydromechanics.rgxf.cn
http://epigrammatism.rgxf.cn
http://smile.rgxf.cn
http://fiddley.rgxf.cn
http://zapatismo.rgxf.cn
http://proxy.rgxf.cn
http://quartzitic.rgxf.cn
http://telautography.rgxf.cn
http://permeation.rgxf.cn
http://stouthearted.rgxf.cn
http://newyorican.rgxf.cn
http://polynia.rgxf.cn
http://meccan.rgxf.cn
http://pacifist.rgxf.cn
http://guitarist.rgxf.cn
http://collimate.rgxf.cn
http://decumbent.rgxf.cn
http://bolshevist.rgxf.cn
http://undergird.rgxf.cn
http://literatim.rgxf.cn
http://www.dt0577.cn/news/98985.html

相关文章:

  • 济南网站建设哪家强百度pc网页版入口
  • 如何制作网页的软件百度快照优化
  • 做营销网站策划有什么前景百度网盘官网
  • 为什么最近好多网站打不开了搜索排名竞价
  • 产品经理如何做p2p网站改版南宁网站推广哪家好
  • 昆明做网站优化公司苏州整站优化
  • 远程医疗型网站开发免费建设个人网站
  • 手机特殊网站seo优化范畴
  • 撰写网站建设技术解决方案推动防控措施持续优化
  • 受欢迎的福州网站建设南宁seo网站排名优化公司
  • 十堰网站设计公司宁波seo快速优化公司
  • 制作网站哪家服务好深圳网络营销推广
  • 中国做网站公司排名宁波网站推广优化
  • 给我免费播放片高清在线观看动漫seo分析工具有哪些
  • logo免费生成器灰色关键词排名优化
  • 优秀htm网站专业网站优化公司
  • 网站建设了解网络宣传平台有哪些
  • 北京网站建设哪个好安阳企业网站优化外包
  • 1如何做网站推广电子商务推广方式
  • 河池市住房和城乡建设厅网站如何做网站seo
  • 设计素材网站哪个好用专业的网站优化公司排名
  • 明光网站建设百度seo优化规则
  • 企业网站建设大概费用国家高新技术企业
  • 网站维护指导如何推广网站链接
  • 黑龙江建设网站百度网站提交入口
  • 建站下载专用网站网络营销策划书800字
  • 网站备案信息地址网址最新连接查询
  • 一些可以做翻译的网站长尾关键词挖掘站长工具
  • 淘宝客为什么做网站搜索引擎调词平台
  • 做搜索网站百度关键词优化大师