0
Need a hand on this code!
public class Clerk { GroceryStore myStore; public void takePosition(GroceryStore store) { myStore = store; } public double ringUp(GroceryItem[] item) { double total = 0; int itemNumber = 0; while (item[itemNumber] != null) { total = total + item[itemNumber].price; System.out.println(item[itemNumber].name + " " + item[itemNumber].price); itemNumber = itemNumber + 1; } System.out.println("TOTAL " + total); return total; } public void pay(double amount) { myStore.money = myStore.money + amount; } }
2 Antworten
0
Take a look at these guides on how to ask a question.
https://stackoverflow.com/help/how-to-ask
https://www.sololearn.com/blog/38/8-simple-rules-to-get-help-from-the-community
0
while (itemNumber < item.length &&
item[itemNumber] != null) {