Question: PROBLEM 2 Problem Statement Develop a well - documented function called shipping cost that calculates the cost of shipping a package based on the package
PROBLEM
Problem Statement
Develop a welldocumented function called shipping cost that calculates the cost of shipping a package based on the package weight and type of service according to the price schedule listed in Table Your function should be saved in a file called shippingcost.
Program Requirements
The function should have two input arguments, in this order: the weight of the package and a numerical value indicating the desired shipping service: ground, second day, and overnight.
The function should return two values, in this order: a number indicating success or failure and the cost of shipping the package. For example, when computing the cost of shipping a lb package by ground service, the return values would be and If the input values are invalid, or the type of service is not available for a package with the given weight, the function should return and
If a weight larger than is entered for ground service, the function should return and
If a weight larger than is entered for day service, the function should return and
If a weight larger than is entered for overnight service, the function should return and
Hints: Consider using the cei function in your cost calculation to roundup the weight.
Table Shipping Cost Schedule
tabletableShippingServicePackage WeightGreater than
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
