Loan Amortization Calculator with Servlet as View/Controller
Objective:
What to do:
Write a Java Web application using a servlet and Java class that will calculate an amortization table for a loan. An amortization table shows the monthly payment, the amount paid to interest, the amount paid down on the balance, and the monthly final balance over the life of a loan. When completed your application should produce output with numbers like that shown in Figures 1 and 2. As you can see in Figure 1, these values are for a 30year loan with a principle of $200.000 at 6% interest. Your application should work correctly for any reasonable values of loan properties.
You should make the following components for this assignment:
Loan.java: This defines a loan object. You may adjust this class as needed. Here the Total Term is the total number of months in the life of the loan:
Monthly Payment = Principle * Monthly Rate / (1 - (1 + Monthly Rate) ^ -Total Term ))
Amortization.java: This component will provide the amortization table portion of the output shown in Figures 1 and 2 when the doAmortization method is called. You may adjust this class as needed.
Some other relationships that you will need to complete the view are:
index.jsp: an html form page that allows the user to enter the initial loan information. Use textboxes and buttons. When the form is submitted, the AmortizationServlet class will be called to create the loan amortization output.
AmortizationServlet: a servlet that will:
1. Get the data from the request.
2. Create a Loan and an Amortization object
3. Use the Loan and Amortization object to calculate the amortization table
4. Get values from Amortization object and incorporate it into the HTML for response to the client.