Ask your own question, for FREE!
Computer Science 15 Online
OpenStudy (happykiddo):

Write an algorithm to settle the following question: A bank account starts out with 10,000. Interest is compounded monthly at 0.5 percent per month. Every month, $500 is withdrawn to meet college expenses. After how many years is the account depleted? – Note you don’t have to supply the number of years it takes the account to deplete just the “algorithm” that would be used to answer that question.

OpenStudy (happykiddo):

initial_amount = 10000 interest_per_month = 0.5 withdrawn_per_month = 500 final_amount = 0 new_amount1 = ((initial_amount * interest_per_month) + interest_per_month) - withdrawn_per_month new_amount2 = ((new_amount1 * interest_per_month) + interest_per_month) - withdrawn_per_month new_amount3= ((new_amount2 * interest_per_month) + interest_per_month) - withdrawn_per_month

OpenStudy (happykiddo):

This is how far I've gotten. How would I loop this until whatever "new_amount" is equal to 0. And by the way I'm using Python.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!