Write program in Java. You work for a package shipping company and are writing a program to
Question:
Write program in Java.
You work for a package shipping company and are writing a program to determine shipping rates.
The rates are determined by the following rules: If a package weighs less than 16 ounces and measures less than 12 inches wide, the shipping rate is $1 to deliver it anywhere in the continental US.
If a package weighs 16 ounces or more or measures 12 inches wide or more, the shipping rate is determined by multiplying the weight in ounces by $0.10 and the width in inches by $0.15.
The shipping rate is the greater of the two numbers. If shipping to Alaska or Hawaii, the shipping rate is doubled. Shipping rates are capped at $10. Prompt the user for the weight and width of the package and what state it is going to.
Tell the user how much it will cost to send the package.
Name your program ShippingRates.
Sample Output:
What is the weight of the package (in ounces)? 10
What is the length of the package (in inches)? 30
What state is the destination? Minnesota
The shipping cost is $4.50
Note: use System.out.printf to ensure 2 decimals are output for the answer.
Linear Algebra And Its Applications
ISBN: 9781292351216
6th Global Edition
Authors: David Lay, Steven Lay, Judi McDonald