Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started