Question: You and your partner are programming software for a delivery company. The employee inputs the weight of the package and the distance to be delivered.

 You and your partner are programming software for a delivery company.
The employee inputs the weight of the package and the distance to

You and your partner are programming software for a delivery company. The employee inputs the weight of the package and the distance to be delivered. The cost of sending a package by an express delivery service is $15.00 for the first two pounds, and $5.00 for each pound or fraction thereof over two pounds. If the package weighs more than 70 pounds, a $15.00 excess weight surcharge is added to the cost. No package over 100 pounds will be accepted. Additionally, the cost of delivery is $0.15 per mile for the first 50 miles, and $0.05 per mile thereafter. Write a program that accepts the weight of a package in pounds and distance to delivery in miles, and computes the cost of mailing the package. Be sure to handle the case of overweight packages. (1) Ask for the weight in pounds (2) Determine if the weight is valid --if not valid state: This package exceeds the maximum weight of 100 lb. (3) Ask for the distance in miles (4) Use appropriate if-statements to calculate the cost Use fprintf to display the output. Display each variable to 2 decimal places. Determine the appropriate output and display the following in one line: The total cost for a package weighing X lb and traveling Y miles is: $Z

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!