Answer:
is_silver = False
is_gold = False
is_premium = False
balance = float(input("Enter the balance: "))
rate = float(input("Enter the annual interest rate: "))
for i in range(3):
balance += balance * 0.15
print("The balance after " + str(i+1) + " year is $" + str(balance))
if balance > 10000 and is_premium == False:
print("You are now a premium bank club member.")
is_premium = True
print("You are exceeding " + str(balance - 10000) + "$ for that status")
elif balance > 5000 and is_gold == False and is_premium == False:
print("You are now a gold bank club member.")
is_gold = True
print("You are exceeding " + str(balance - 5000) + "$ for that status")
elif balance > 1000 and is_silver == False and is_gold == False and is_premium == False:
print("You are now a silver bank club member.")
is_silver = True
print("You are exceeding " + str(balance - 1000) + "$ for that status")
Step-by-step explanation:
*The code is in Python.
Set the is_silver, is_gold and is_premium as False
Ask the user to enter the balance and rate
Create a for loop that iterates three times. Inside the loop:
Add the interest to the balance (cumulative sum)
Print the balance
Check the balance. If it is greater than 10000 and is_premium is False, state that the customer is a premium member, set the is_premium as True, and state how much s/he is exceeding the minimum balance for that status. If the balance is greater than 5000, is_gold is False and is_premium is False, state that the customer is a gold member, set the is_gold as True, and state how much s/he is exceeding the minimum balance for that status. If the balance is greater than 1000, is_silver is False, is_gold is False and is_premium is False, state that the customer is a silver member, set the is_silver as True, and state how much s/he is exceeding the minimum balance for that status.