Question: Write a function howManyMonths ( start , rate, spending, target ) where: start - the starting balance in your bank account ( float ) rate
Write a function howManyMonthsstart rate, spending, target where:
start the starting balance in your bank account float
rate the monthly interest rate float like for
spending the monthly amount that is spent each month float
target the target savings that you'd like to achieve
The function returns how many months it takes to save the target savings amount. The function should return a if the balance goes below because the spending is too high. The function should also return if the target is not reached after months.
Each month you earn the monthly rate of interest, but you also spend the spending amount.
So nextmonthbalance startbalance rate
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
