Question: THIS IS A MATLAB QUESTION!! Write a function called shipping that calculates the cost of shipping a package according to the following price schedule: The

THIS IS A MATLAB QUESTION!!

Write a function called shipping that calculates the cost of shipping a package according to the following price schedule:

THIS IS A MATLAB QUESTION!! Write a function called shipping that calculates

The program asks the user to select the type of service (Ground, Express or Overnight). The program also asks the user to input the weight of the package. It first asks the user to input the number of pounds and then the number of ounces. Write you code such that it does the following and also outputs a similar output as below using fprintf statements. [Run the program with the following test case:

Ground 3 Ib, 12 oz

Express 5 Ibs, 7 oz and

Overnight 8 Ibs, 11 oz.]

As an example, your code will ask input just like below and must display the output just like below when you run your code.

>> shipping

Enter 1 for Ground Service, 2 for Express service and 3 for Overnight: 1

input the pounds component of the package: 8

input the ounce component of the package: 4

The cost to ship 8 pounds and 4 ounces using Ground service is $7.30

Type of Weight Service 0- 0.5 lb 0.5 5Ib More than 5 lb $1.18 +$0.42 for every additional $4.96 $0.72 for every additional Ib Ground (5-7 days) $0.70+$ 0.06/oz 0.5 lb (or fraction) (or fraction) $4.40 $1.20 for every additional $15.20+$1.80 for every additional Ib Express (3-4 days) $2.40 $0.25/oz 0.5 lb (or fraction) (or fraction) $18.60 $4.80 for every additional $61.80+ $6.40 for every additional 1 Overnight (One day) $12.20 +$0.80/oz 0.5 lb (or fraction) b (or fraction)

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 Databases Questions!