ASP.NET
  Home arrow ASP.NET arrow Building a Loan Payment Calculator using A...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

Building a Loan Payment Calculator using ASP.NET 2.0
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 12
    2006-11-29

    Table of Contents:
  • Building a Loan Payment Calculator using ASP.NET 2.0
  • The description of the payment calculator
  • The code behind the finPMT.aspx page
  • Use of validation controls
  • Source code for the finPMT.aspx page

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Building a Loan Payment Calculator using ASP.NET 2.0


    (Page 1 of 5 )

    Making payments to loans for a home or a car is a fact of life. This tutorial is about creating a loan calculator using ASP.NET 2.0. We will be looking at fixed interest loans which are normally quoted for 30, 15, and 10 years.

    This type of loan requires you to pay back equal installments over the period of the loan. In the early part of your loan you will be paying more interest and less principal, and towards the end of the loan period more principal and less interest. There is a plethora of financial loan products apart from this kind of loan. What is assumed in the fixed interest loan is that the rate does not vary during the life of the loan.

    In this tutorial we will be asking the question, suppose one borrows $10,000.00 at an interest of eight percent per annum (per year), to be paid back in 10 months -- what will the monthly payment be? Since banks and loan companies want you to pay on a fixed date each month, your payment may vary depending on whether you make the payment at the beginning of the pay period or the end.

    The interest rate, present value of a loan, future value of a loan, the agreed-to number of payments and the payment per payment period are all inter-related. These are represented by functions in Microsoft Visual Basic. The graphic user interface packages this function in an application with some validation.

    The Financial Web Site

    Start a new web site from the file menu. In this tutorial it is called the Financials, at http://localhost/Financials. Add a web page. This page will be named finPMT.aspx and is the container for your loan payment calculator. In ASP.NET 2.0, in addition to other system namespaces you also have the Microsoft.VisualBasic. The various financial variables used in this application can all be located on the Object Browser as shown in this picture. The highlighted object is the PMT function that will be used. There is a lengthy explanation of how this function works. The arguments that go into this function are clearly explained.

    The PMT Function basics

    The definition of this function as seen in the object browser is as follows:

    Public Function Pmt (ByVal Rate As Double, 
    ByVal Nper As Double, 
    ByVal PV As Double, 
    Optional ByVal FV As Double = 0.0
    Optional ByVal Due As           
    Microsoft.VisualBasic.DueDate = _
    EndOfPeriod) As Double
    

    The graphic user interface will take the input from the text boxes for the Rate, Nper, PV, FV, and DueDate. This is inserted into the above formula and the result is the payment (PMT) that must be paid each period. Since the values that are entered into text boxes are of the string type you will need to convert them to the proper data type. Hence some data conversions are necessary.

    More ASP.NET Articles
    More By Jayaram Krishnaswamy


       · IS the article mission the implementation of Pmt?
       · This tutorial was written to expose the properties and methods of the...
       · I meant MISSING, not mission. Sorry.
       · The PMT is a function that takes couple of arguments described in the article and...
     

    ASP.NET ARTICLES

    - Disadvantages of the ASP.NET MVC Framework
    - Advantages of the ASP.NET MVC Approach
    - ASP.NET Web Forms Weaknesses
    - ASP.NET Web Forms Meets ASP.NET MVC
    - Source Code for Saving and Retrieving Data w...
    - Using GridView to Save and Retrieve Data wit...
    - Handling Dynamic Images in ASP.NET 3.5 AJAX ...
    - Retrieving Data with AJAX and the GridView C...
    - Playing with Images in ASP.NET 3.5 AJAX Appl...
    - Saving and Retrieving Data with AJAX
    - Enhancing PHP Via the ASP.NET AJAX Framework...
    - Enhancing PHP Programming with the ASP.NET A...
    - Classes and ASP.NET AJAX
    - Using ASP.NET AJAX
    - Building a Simple Storefront with LINQ





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT