Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

For example, if a ground type of service is chosen and we want to ship 3 . 2 k g of a package, we have

For example, if a ground type of service is chosen and we want to ship 3.2kg of a package, we have to pay $1.18 as a fixed cost. Since we need to pay for the additional |~3.2-0.50.5~|=6 times 0.5kgs, in total we have to pay: $1.18+6$0.42=$3.70. Similarly, if an express type of service is chosen and we want to ship 7.5?kg of a package, then we have to pay $15.20 as a fixed cost. Since we need to pay for the additional |~7.5-51~|=3 times 1kg, in total we have to pay: $15.20+3$1.80=$20.60.
Write a MATLAB program in a script file that calculates the cost of shipping a package according to the given price schedule. The program should ask the user to enter the type of service (Ground, Express, or Overnight) and the weight of the package provided as a 12 vector (first column for kilograms and second column for grams). By using a switch/case structure, the program should display the cost for the shipment by using fprintf. Run the program for the following cases: a) Ground, 2kg700gr, b) Express, 0kg200gr, c) Overnight, 5kg950gr.
Lab Rules:
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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_2

Step: 3

blur-text-image_3

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

Database Systems Design Implementation And Management

Authors: Carlos Coronel, Steven Morris

14th Edition

978-0357673034

More Books

Students explore these related Databases questions