Question: public class Exercise 0 3 _ ShippingTotal { / * * Scamper Shipping Company specializes in small, local deliveries. * The problems below ask you
public class ExerciseShippingTotal
Scamper Shipping Company specializes in small, local deliveries.
The problems below ask you to implement the logic to calculate a shipping
amount for a package.
You can use these constants in your solutions.
private final int MAXWEIGHTPOUNDS ;
private final double UPTOLBRATE ;
private final double OVERLBRATE ;
Scamper Shipping Company charges $ per pound for items up to and
including pounds. It charges $ per pound for items over pounds.
Return the shipping rate when provided a weight in pounds.
Examples:
calculateShippingRate
calculateShippingRate
calculateShippingRate
calculateShippingRate
public double calculateShippingRateint weightPounds
return ;
Scamper Shipping Company charges $ per pound for items up to and
including pounds. It charges $ per pound for items over pounds.
Implement the logic needed to calculate the shipping cost when provided a
weight in pounds.
You may use calculateShippingRate in your solution.
Examples:
calculateShippingTotal
calculateShippingTotal
calculateShippingTotal
calculateShippingTotal
public double calculateShippingTotalint weightPounds
return ;
Scamper Shipping Company now allows customers to provide a discount code to
give them off of their order.
Implement the logic to calculate the correct shipping rate when provided a
weight in pounds and a boolean value for hasDiscount.
You may use any previous methods in your solution.
Examples:
calculateShippingTotal false
calculateShippingTotal true
calculateShippingTotal false
calculateShippingTotal true
calculateShippingTotal false
calculateShippingTotal true
calculateShippingTotal false
calculateShippingTotal true
public double calculateShippingTotalint weightPounds, boolean hasDiscount
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
