Computer Science, asked by moon8577, 3 months ago

Write a decision making program.

Please do help​

Attachments:

Answers

Answered by jai696
1

\huge\red{\mid{\fbox{\tt{Using\: Python\: 3}}\mid}}

def discount(amount):

keys = ["Discount", "Final Amount", "Gift"]

if amount <= 2000:

discount, gift = amount * .05, "Wallet"

final = amount - discount

return dict(zip(keys, [discount, final, gift]))

if 2000 < amount <= 5000:

discount, gift = amount * .08, "Clock"

final = amount - discount

return dict(zip(keys, [discount, final, gift]))

if 5000 < amount <= 10000:

discount, gift = amount * .1, "Bag"

final = amount - discount

return dict(zip(keys, [discount, final, gift]))

discount, gift = amount * .15, "Watch"

final = amount - discount

return dict(zip(keys, [discount, final, gift]))

for k, v in discount((amount := float(input("enter amount: ")))).items():

print(f"{k}: {v}")

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Similar questions