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:
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started