Loan Amortization Calculator with Servlet as View/Controller

Objective:

  • Build a working application with Servlet and Java Components

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:

  • monthly payment to interest = monthly interest rate * current balance
  • monthly payment to balance = monthly payment - monthly payment to interest
  • current balance (after payment) = current balance (before payment) - monthly payment to balance

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.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.