Question: Modify the below program so that the user is allowed to enter multiple weights of packages until the user has no more packages to input.

Modify the below program so that the user is allowed to enter multiple weights of packages until the user has no more packages to input. The program should print the charges for each package entered. Before the program ends, it should print the total charges of all packages.

Requirement :

Pseudocode

Flowchart

Python (py.file)

Output

print("The Fast Freight Shipping Company")

userWeightOfPackage = int (input("Please enter the weight of the packages:")) #getting the input weight of package

#use if elif to pass the weight and the price

if userWeightOfPackage <= 2: #function for weight

shippingCharges = 1.10 #Price

elif userWeightOfPackage < 7:

shippingCharges = 2.20

elif userWeightOfPackage < 11:

shippingCharges = 3.70

else:

shippingCharges = 3.80

#after the else if read it it will print out here the weight and the price.

print(" For a package weighing " +str(userWeightOfPackage) + ",You'll pay $" + format( shippingCharges, ",.2f" ) )

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!