让我卡住的代码部分是最后打印出来并让它为最终的 system.out 消息添加数组的 BILL 部分并正确显示它。数组和程序的其余部分工作正常,这只是我遇到问题的最后一部分。
private static void printBilling() {
int numberOfCustomers = Accounts.length;
int sum=0;
System.out.println("\n\nTable showing charges for cell phones");
for (int customer=0; customer<numberOfCustomers; customer++){
System.out.printf ("%s %s %s:\n GB used = %s Please Pay %s \n\n",
Accounts[customer][NAME],
Accounts[customer][ACCT],
Accounts[customer][SELECTION],
Accounts[customer][USED],
Accounts[customer][BILL]);
}
sum+= Accounts.length[customer][BILL];
{
System.out.printf ("The total owed is %s", +sum);
}
慕标5832272
相关分类