Answer to Question #288835 in Python for Arab

Question #288835

A credit card company calculates a customer's "minimum payment" according to the following formula. The minimum payment is equal to either $10 or 19.9% of the customer's balance, whichever is greater; but if this exceeds the balance, then the minimum payment will be the balance. Write a program to print out the minimum payment using Python built-in functions min and max.

Example 1: If your balance is 1000, then your program should print "The minimum payment is 199".

Example 2: If your balance is 600, then your program should print "The minimum payment is 119.40".

Example 3: If your balance is 25, then your program should print "The minimum payment is 10".

Example 4: If your balance is 8, then your program should print "The minimum payment is 8".


1
Expert's answer
2022-01-19T10:35:37-0500
balance = float(input("Enter your balance: "))
min_payment = max(10, 0.199*balance)
min_payment = min(balance, min_payment)

print("Your minimal payment is ${:.2f}".format(min_payment))

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