Methods Summary |
---|
public java.lang.String | Buy(PurchaseOrder PO)Process a purchase order.
String receipt = Integer.toString(nextReceiptNumber++);
for (int i=0; i<PO.getItems().length; i++) {
LineItem item = PO.getItems()[i];
receipt += "\n " + item.getQuantity() + " " + item.getName();
}
return receipt;
|
public void | Ping()Let the world know that we are still alive...
|
public double | RequestForQuote(java.lang.String productName, int quantity)Request a quote for a given quantity of a specified product
if (quantity < 100) {
return 1.0 * quantity;
} if (quantity < 1000) {
return 0.8 * quantity;
} else {
return 0.7 * quantity;
}
|
public java.lang.String | SimpleBuy(java.lang.String productName, java.lang.String address, int quantity)Purchase a given quantity of a specified product
return Integer.toString(nextReceiptNumber++) + "\n" +
quantity + " " + productName;
|