Answer to Question #228145 in Python for Shanta

Question #228145

Write a python program that takes the weight of luggage from the user and prints the total amount the user needs to pay according to the given conditions:

  • The user has to pay Tk.200 if the weight is 10kg or less.
  • The user has to pay Tk.200 and an additional Tk.50 for every 1kg over 10kg.
  • Service charges is 5% of the total weight.
  • Maximum weight of luggage is 30kg.
1
Expert's answer
2021-08-22T07:15:22-0400
w= int(input("Enter weight of luggage: "))
a = 0
if w<=10:
    a=200
    service = (5/100)*w
    amount = a+service
    print("The total amount to be paid is ", amount)


elif w<=30:
    wt= 30-10
    a= 200 + (wt*50)
    service = (5/100)*w
    amount = a+service
    print("The total amount to be paid is ", amount)
else:
    print("Overweight")



Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS