Answer:
# user is prompt to enter balance
balance = int(input("Enter your balance: "))
# 21% of the balance is calculated
balancePercent = 0.021 * balance
# The greater of $10 and balance persent is assigned to minimumPayment using max()
minimumPayment = max(10, balancePercent)
# the least between minimumPayment and the balance is assigned to minimumPayment using min()
minimumPayment = min(minimumPayment, balance)
# minimumPayment is displayed to user
print(minimumPayment)
Step-by-step explanation:
The program is written in Python3 and well commented. First the user is prompt to enter the balance. Then 21% of the balance is computed and assigned to balancePercent. Then using max( ) we find the maximum between 10 and the balancePercent which is assigned to minimumPayment.
The we use min( ) to find the minimum between the existing minimumPayment and the balance and assigned to minimumPayment.
The minimumPayment is then displayed to user.
max( ) and min( ) are inbuilt function of python that is use to get the maximum and minimum of the passed arguments.