Interest calculation with while

3 次查看(过去 30 天)
Tony Jacob
Tony Jacob 2016-9-29
I have no idea where to start for this problem, any help would be appreciated.
Use a while loop to determine how many months it will take to accumulate $1.5 million in your retirement account under the following conditions: initial deposit = $1,000, interest is 0.5%, per month and you pay $750 into the account each month.

回答(1 个)

Rani V.S
Rani V.S 2016-10-3
编辑:Rani V.S 2016-10-3
sum=1000
month=0
while sum<1500000
sum=(sum+750)*1.5
month=month+1
end
disp(month)
  1 个评论
Walter Roberson
Walter Roberson 2016-10-3
That would be 50% interest per month, not 1/2 % interest per month.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by