%Purpose: calculate the bank balance
%Author: Jie Zhang
%Date:   Oct. 24, 2013
%Comments: this is for the CDS130 class

clear %clear the workspace 

Balance(1)=5000;  %the balance in the first year

%use iternation to calculate the balance in the next ten years
for i=[1:10]
    Balance(i+1)=Balance(i)+Balance(i)*0.20;
end

Balance  %print the balance

plot(Balance)  %plot the balance

