import javax.swing.*; public class CashierFour { public void ringUpCustomer(String customerName) { String item; double total = 0.0, milkPrice = 3.50, bottleWaterPrice = 1.0; double sugarPrice = 1.25; do { item = JOptionPane.showInputDialog("Enter Item Description"); if (item.equals("milk")) { total = total + milkPrice; } else if (item.equals("bottleWater")) { total = total + bottleWaterPrice; } else if (item.equals("sugar")) { total = total + sugarPrice; } } while (!item.equals("end")); String reply = customerName + ", thank you for shopping with us.\n"; reply = reply + "Amount Due: $" + total; JOptionPane.showMessageDialog(null, reply); } }