public class Order {
boolean isFilled;
double billAmount;
String shipping;
public Order(boolean filled, double cost, String shippingMethod) {
if (cost > 24.00) {
[Link]("High value item!");
}
isFilled = filled;
billAmount = cost;
shipping = shippingMethod;
}
public void ship() {
if (isFilled) {
[Link]("Shipping");
[Link]("Shipping cost: " + calculateShipping());
} else {
[Link]("Order not ready");
}
}
public double calculateShipping() {
// declare conditional statement here
public static void main(String[] args) {
// do not alter the main method!
Order book = new Order(true, 9.99, "Express");
Order chemistrySet = new Order(false, 72.50, "Regular");
[Link]();
[Link]();
}
}
public class Order {
boolean isFilled;
double billAmount;
String shipping;
String couponCode;
public Order(boolean filled, double cost, String shippingMethod, String coupon) {
if (cost > 24.00) {
[Link]("High value item!");
}
isFilled = filled;
billAmount = cost;
shipping = shippingMethod;
couponCode = coupon;
}
public void ship() {
if (isFilled) {
[Link]("Shipping");
[Link]("Shipping cost: " + calculateShipping());
} else {
[Link]("Order not ready");
}
}
public double calculateShipping() {
if ([Link]("Regular")) {
return 0;
} else if ([Link]("Express")) {
// Add your code here
} else {
return .50;
}
}
public static void main(String[] args) {
// do not alter the main method!
Order book = new Order(true, 9.99, "Express", "ship50");
Order chemistrySet = new Order(false, 72.50, "Regular", "freeShipping");
[Link]();
[Link]();
}
}