The U.S. post office has rules about mailing packages. A package cannot be mailed first class if the sum of its length and girth is greater than 100 inches, or if the package weighs more than 70 pounds.
Girth is the perimeter around the height and width, where the length is defined as the longest of the three dimensions.
Here is a visual representation of girth:
Write a program that takes in the weight of the package and the three dimensions of the package in any order. (You may put all your code in the main() method.) The program should determine the longest dimension of the package, calculate the girth, and compute the size of the box. The program should then print out one of the following messages about this package:
Let’s look at how to design this class.
Prompt user for weight
Determine longest of three dimensions
Calculate the girth using the other two dimensions
if package is too big and too heavy, print appropriate message
Name your class PX_LastName_FirstName_CheckMail
and submit it below.
You must Sign In to submit to this assignment
Last modified: November 04, 2024
Back to Summary