Ask Question
10 October, 21:03

The shipping charges per 500 miles are not prorated. For example, if a 2-pound package is shipped 550 miles, the charges would be $2.20. Write a program that asks the user to enter the weight of a package and then displays the shipping charges.

+2
Answers (1)
  1. 10 October, 22:51
    0
    The solution code is written in Python:

    COST_PER_500MI = 1.1 weight = float (input ("Enter weight of package: ")) total_cost = weight * COST_PER_500MI print ("The shipping charges is $" + str (round (total_cost, 2)))

    Explanation:

    Based on the information given in the question, we presume the cost per 500 miles is $1.10 per pound ($2.20 / 2 pound).

    Create a variable COST_PER_500MI to hold the value of cost per 500 miles (Line 1). Next, prompt user input the weight and assign it to variable weight (Line 3). Calculate the shipping charge and display it using print function (Line 4-5).
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “The shipping charges per 500 miles are not prorated. For example, if a 2-pound package is shipped 550 miles, the charges would be $2.20. ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers