matlab
posted by sean .
One bank pays 5.5 percent annual interest, while a second bank pays
4.5 percent annual interest. Determine how much longer it will take to
accumulate at least $50 000 in the second bank account if you deposit
$1000 initially and $1000 at the end of each year.
need help writing a script for matlab using the for,while loops.
this is what i have so far but its not giving me anything.
r2=.045;
P=1000;
n=1;
count=0
for t=0:99
A=P(1+r2/n)^(nt);
if A<50000
A=P(1+r2/n)^nt;
count=t
end
end
disp(count)

matlab 
sophia
amount= 1000;
k=0;
while amount < 50000
k=k+1;
amount =amount*1.045 +1000;
end
amount
k
amount = 5.0711e+004
k = 26
this is the correct answer 
matlab 
sophia
amount= 1000;
k=0;
while amount < 50000
k=k+1;
amount =amount*1.045 +1000;
end
amount
k
amount = 5.0711e+004
k = 26
this is the correct answer
Respond to this Question
Similar Questions

fin
If you deposit $10,000 in a bank account that pays 10 percent interest annually, how much money will be in your account after 5 year? 
Finance
A bank offers your firm a revolving credit arrangement for up to $85 million at an interest rate of 2.5 percent per quarter. The bank also requires you to maintain a compensating balance of 4 percent against the unused portion of the … 
Economics
Suppose you deposit $5,000 in a bank which pays 10 percent interest compounded twice a year. The actual annual interest rate you receive is: a 10 b11 c10.25 d12 
Alg2
Help....Help... Suppose you deposit a principal amount of p dollars in a bank account that pays compound interest. If the annual interest rate r (expressed as a decimal) and the bank makes interest payments n times every year, the … 
Alg 2
Suppose you deposit a principal amount of p dollars in a bank account that pays compound interest. If the annual interest rate r (expressed as a decimal) and the bank makes interest payments n times every year, the amount of money … 
math
You receive $12,000 and looking for a bank to deposit the funds. Bank A offers an account with an annual interest rate of 3% compounded semiannually. Bank B offers an account with 2.75% annual interest rate compounded continuously. … 
Finance
You receive $12,000 and looking for a bank to deposit the funds. Bank A offers an account with an annual interest rate of 3% compounded semiannually. Bank B offers an account with 2.75% annual interest rate compounded continuously. … 
Finance
You receive $12,000 and looking for a bank to deposit the funds. Bank A offers an account with an annual interest rate of 3% compounded semiannually. Bank B offers an account with 2.75% annual interest rate compounded continuously. … 
fin
You are able to deposit $850 into a bank CD today and you will only withdraw the money once the balance is $1,000. If the bank pays 5 percent interest, how long will it take you to attain your goal? 
Algebra
Jon invested a total of $40,000 in 3 different bank accounts. One pays an annual interest rate of 3%, the second account pays 5% annual interest and the third account pays 6% annual interest. In one year, Jon earned a total of $1960 …