我也已经声明了所有变量,但是我不确定为什么它显示0
这是代码:
System.out.printf("| %10s | %10s | %10s | %10s | %15s| %15s |\n", "DC", noDC,df.format(tables.foodCost[0]), tables.foodWeight[0], df.format(tables.foodCost[0]*noDC), df.format(tables.foodWeight[0]*noDC/1000)+" kg");
System.out.println("|------------|------------|------------|------------|----------------|-----------------|");
totCost = totCost+tables.foodCost[0]*noDC;
totWeight = totWeight+tables.foodWeight[0]*noDC;