1 Suppose that 1000 is deposited into an account that pays 5
1
Suppose that $1000 is deposited into an account that pays 5% interest per year. at the end of each year, th amount in the account is 1.05 times the amount at the beginning of the year. write a MATLAB program with a for loop to calculate the amount in the account after 10, 20, and 30 years.
2
Repeat problem 1, assuming that the interest is compounded quarterly; that is, one-fourth of the annual interest (1.25%) is added to the account every three months. Also, repeat the problem with monthly compounding.
3
For the account described in Problem 1, write a MATLAB program with a while loop to determine the number of years required for the amount in the account to reach $5,000.
Solution
1.
in going from any year to the next,
the Balance will change by having 5% of it added to itself, i.e., new Balance = current Balance + (0.05)(current Balance) = (1.08)(current balance)
after 10 years
MATLAB code
Balance = 1000; %initialize Balance
for year = 1:10
Balance = (1.05)*Balance;
end
Balance %This will display the final Balance
for 20 years
MATLAB code
Balance = 1000; %initialize Balance
for year = 1:20
Balance = (1.05)*Balance;
end
Balance %This will display the final Balance
for 30 years:
MATLAB code
Balance = 1000; %initialize Balance
for year = 1:30
Balance = (1.05)*Balance;
end
Balance %This will display the final Balance

