Question: Problem 5 : Box Shipping Write a program to calculate the total shipping cost for a package based on its weight and shipping distance. The

Problem 5: Box Shipping
Write a program to calculate the total shipping cost for a package based on its weight and shipping distance. The program prompts the user to input the weight of the package in kilograms (weight must be at least 1 KG ) and the shipping distance in kilometers (distance must be positive). The program then calculates the shipping cost based on the following criteria:
For Weight 5kg(small):
If distance 100km : Cost = AED 4.5 per kg
If distance >100km : Cost = AED 6.5 per kg
For 5kg Weight 20kg(medium):
If distance 100km : Cost = AED 5.5 per kg
If distance >100km : Cost = AED 7.2 per kg
For Weight >20kg(large):
If distance 100km : Cost = AED 6.4 per kg
If distance >100 km : Cost = AED 9.2 per kg
Problem 5 : Box Shipping Write a program to

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