编写一个程序,使用数组按价格升序对10个玉米饼的价格进行排序。我在试着给玉米饼分类。用户必须输入10个玉米饼的名称和价格,我按升序排序。}我想要的结果有点类似于elcome到玉米饼价格排序!输入10个玉米饼的名字和价格,我会排序的!taco 4Enter taco's priceEnter the name of taco 5
Chicken Soft Taco
用我目前的代码,用户可以一次输入一个墨西哥玉米卷,但当我运行它时,我将输入第一个玉米饼的名称,然后价格自动列出“输入塔科价格”1到10。这是如何解决的。我很有信心,当涉及到循环的时候,我做错了什么。stub
System.out.println("Welcome to the tacoEnter 10 taco names and prices and I'll sort it!&qu
我试图对每个玉米饼(1-10)的价格进行冒泡排序,同时让玉米饼名称遵循它们的原始价格(玉米饼名称不需要排序)。但是,我在排序的if语句中收到错误消息。stub
System.out.println("Welcome to the tacoEnter 10 taco names and prices and I'll sort it!");
/
控制台输出为:Field error in object 'taco' on field 'name': rejected value [];这是我的代码:designController.java public String postTaco(@Valid Tacotaco, Order order, Errors e