public class Order
{
private int widgets;
private double price;
public Order(double undiscountedUnitPrice)
{
price = undiscountedUnitPrice;
widgets = 0;
}
public void addWidgets(int quantity)
{
widgets = widgets+quantity;
}
public double getTotalPrice()
{
return price*widgets;
}
public double getUnitDiscount()
{
if(widgets>10000)
{
if((widgets-10000)/1000>47.5)
double toTakeOff = (((widgets-10000)/1000)*.10);
price = (10000*price)+((widgets-10000)*price-toTakeOff);
else
price = widgets*price;
}
}
}
on the double toTakeOff is where I get the .class expected.
Thanks!