Answer to Question #209070 in Electrical Engineering for mona

Question #209070

Write and execute a PYTHON program to perform separate files for each of the tasks

1. In a supermarket, when paying your bill amount, if your amount exceeds RO.100, You have an option of Cash or Credit Card. If you pay as cash you will get 6% of discount from your original amount, but for Credit Card there is no discount. When your amount is less than RO.100 you will have to pay by cash only with the discount of 3%


1
Expert's answer
2021-06-24T11:37:01-0400
amount =float(input('Enter amount: '))
if amount<100:
    discount=amount*0.03
    amount-=discount
    print(f'The discount of 3% is: {discount}')
    print(f'Your bill amount: {amount}')
else:
    answer=0
    while(answer<1 or answer>2):
        answer=int(input('1. Cash or 2. Credit Card?: '))
    if answer==1:
        discount=amount*0.06
        amount-=discount
        print(f'The discount of 6% is: {discount}')
        print(f'Your bill amount: {amount}')    
    else:
        print(f'No discount')
        print(f'Your bill amount: {amount}')    




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
APPROVED BY CLIENTS