Question: ackage com.techelevator; public class Exercise 0 5 _ AcceptPackage { / * Scamper Shipping Company specializes in small, local deliveries. The problems below ask you

ackage com.techelevator;
public class Exercise05_AcceptPackage {
/*
Scamper Shipping Company specializes in small, local deliveries.
The problems below ask you to implement logic if they can accept a package for delivery.
Note: all weights are in pounds, and all dimensions are in inches.
*/
// You can use these constants in your solutions.
private final int MAX_WEIGHT_POUNDS =40;
private final int MAX_CUBIC_INCHES =10_368;
private final int MAX_DIMENSION_INCHES =66;
/*
Scamper Shipping accepts packages as long as they are 40 pounds or less.
Implement the logic to determine if Scamper Shipping accepts a package based on the weight provided.
Examples:
acceptPackage(20) true
acceptPackage(40) true
acceptPackage(50) false
*/
public boolean acceptPackage(int weightPounds){
if (acceptPackage(weightPounds)<=MAX_WEIGHT_POUNDS){
return true;
} else {
return false;
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!