Asp > Mathematics
Mortgage Amortization
Mortgage Amortization
<% Dim P 'Payment Dim I 'Interest Dim L 'Loan Term In Years Dim J Dim N Dim M Dim H Dim C Dim Q Dim X 'Set the Conter for the Ammoritization X=0 'Hard Code Some Loan Values HERE 'Replace these with your variables 'Total of Loan Amount P=100000 'Interest Rate I=7 'Loan term in years L=30 'Calculate Monthly Interest J=I/(12 * 100) 'Length of loan in Months N=L * 12 'Now the magic..... M = P * ( J / (1 - (1 + J) ^ -N)) Response.Write "
Monthly Payment: " & Round(M, 2) & "
" Response.Write "
" Response.Write "
Interest Paid
" Response.Write "
Principal Paid
" Response.Write "
Remaing Balance
" Response.Write "
" 'Loop through And Get the Monthly Paymen ' ts for the length of the loan Do While X < N H=P*J Response.Write "
" & Round(H, 2) & "
" C=M-H Response.Write "
" & Round(C, 2) & "
" Q=P-C Response.Write "
" & Round(Q, 2) & "
" P=Q X=X+1 Loop %>
Asp Codes
ActiveX
ADO
Array
Code Snippets
Components
Data Access
Date Time
Files
Graphics
HTML Formatting
Mathematics
Miscellaneous
Sessions
SQL
Strings
Techniques
XML