disp(' ');
disp(' loan.m  ver 1.0  November 30, 2009 ');
disp(' by Tom Irvine  Email: tomirvine@aol.com ');
disp(' ');
disp(' Loan calculation script for principal and interest. ');
%
disp(' ');
 L=input(' Enter loan amount ');
 m=input(' Enter the number of months ');
Ia=input(' Enter interest rate % ');
%
i=Ia/1200;
%
p=i*L/(1-(1+i)^(-m));
%
disp(' ');
out1=sprintf(' The monthly payment is:  %10.2f ',p);
disp(out1);
disp(' ');
total=p*m;
out1=sprintf(' The total paid back is: %10.2f ',total);
disp(out1);
out1=sprintf(' The total interest is: %10.2f ',total-L);
disp(out1);