private double getOutstanding(double initalValue) { double result = initalValue; Enumeration<Order> e = _orders.elements(); while (e.hasMoreElements()) { Order each = (Order) e.nextElement(); result += each.getAmount(); } return result; }
public void printOwing(double previousAmount) { // Enumeration<Order> e = _orders.elements(); double outstanding = previousAmount * 2.2; this.printBanner(); // while (e.hasMoreElements()) { Order each = (Order) e.nextElement(); outstanding += each.getAmount(); } this.printDetails(outstanding); }