Assignment MVC: Loan Amortization Application (MVC)

What to do:

Write a Java Web application using the MVC design pattern 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 the same output as your Loan Amortization with JSP assignment.

You must make the following components for this assignment:

Loan.java: This defines a loan object. The Loan object should have principal, monthly rate, and total term as fields. It should have at least two constructors, a getter/setter pair for each instance variable, a toString() method and a method that allows one to get a monthly payment. Here the Total Term is the total number of months in the life of the loan:

Monthly Payment = Principal * Monthly Rate / (1 - (1 + Monthly Rate) ^ -Total Term ))

(It's okay to reuse this class from a previous assignment assuming it was correct in that assignment.)

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. The Amortization class will include a Loan object as an instance variable. It will also have at least two constructors, a getter/setter pair for the instance variable, and a doAmortization method that will return a String containing the html based amortization table.

(It's okay to reuse this class from a previous assignment assuming it was correct in that assignment.)

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. These should be entered as yearly values (APR and term in years). Use textboxes and buttons. When the form is submitted, the AmortizationServlet will be called to create the loan amortization output.

AmortizationServlet: a servlet page that will:

  • Get the data from the request.
  • Create a Loan and an Amortization objects
  • Use the Loan and Amortization object to calculate the amortizationtable

amortization.jsp: a view page that will:

  • Get values from AmortizationServlet 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.