All pastes #233373 Raw Edit

Untitled

public java v1 · immutable
·published 2006-11-01 22:28 UTC
rendered paste body
    public double calculateDeliveryCost(){                //instance varibles        double deliveryCost = 0;        double aleCost=0;        Ale ale;        Iterator itr = products.iterator();        Product product;                //go through order and check is product is an ale        while (itr.hasNext()) {            product = (Product) itr.next();            //if product is an ale add to ales list            if(product.getClass().toString().equals("class Ale"))			{				aleCost += product.getPrice();            }			deliveryCost += 2;        }		if(aleCost >= 50){			deliveryCost = 0.00;        }		return deliveryCost;    }