Question: Write a program in Java that asks user to enter: the shipping type, the weight of a package, and the number of miles shipped. The

Write a program in Java that asks user to enter: the shipping type, the weight of a package, and the number of miles shipped. The program will then calculate and display thThe Fast Freight Shipping Company provides three types of package shipping:
1. Ocean Freight Shipping: base charge $3.99 for the first 2 pounds
2. Air Flight Shipping: base charge $6.99 for the first 2 pounds
3. Ground Shipping: no base charge
For the rest pounds over 2 pounds, the company charges the following rate:
Weight of Package Shipping Rate Per 500 miles Per 2 pounds
2 pounds or less $1.10
Over 2 pound but no more than 6 pounds $2.20
Over 6 pound but no more than 10 pounds $3.70
Over 10 Pounds $3.80
Notes:
1.The shipping rate per 500 miles per 2 pounds are not prorated.
2. If the user chooses ground shipping, there is no base charge. The weight column in the shipping rate table should be the entire package weight.
3. If the user chooses ocean freight or air flight, there is a base charge for the first 2 pounds. The weight column in the shipping rate table should be the package weight -2 pounds.
4. For packages less than 2 pounds and shipped by ocean freight or air flight, the total shipping charge is the base charge no matter how many miles shipped.
For example,
if a 3.5-pound package is shipped 550 miles by ocean freight, the shipping charges will be 3.99+1.10*2=6.19.
If a 6.5-pound package is shipped 1150 miles by air flight, the shipping charges will be 6.99+2.20*3*3
if a 12.5-pound package shipping 1000 miles by ground shipping, the shipping charges will be 3.80*2*7e shipping charges for the package.

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!