Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

import javautilScanner public class ShippingRates public static void mainString args Scanner scanner ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Linear Algebra And Its Applications

Authors: David Lay, Steven Lay, Judi McDonald

6th Global Edition

978-1292351216, 1292351217

More Books

Students also viewed these Programming questions

Question

e. What are the programs research and clinical focus areas?

Answered: 1 week ago

Question

Compute det B 4 , where B || 23 045 56

Answered: 1 week ago

Question

$281.25 is 225% of what amount?

Answered: 1 week ago