Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Loan Amortization Calculator with JSP as View/Controller ....Using eclipse What to do: Write a Java Web application using a JSP and Java classes that will

Loan Amortization Calculator with JSP as View/Controller ....Using eclipse

What to do:

Write a Java Web application using a JSP and Java classes 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 30 year loan with a principle of $20,000 at 6% interest. Your application should work correctly for any reasonable values of loan properties.

Your version of this output should be sent to the browser as the response from a jsp file. In addition, your program should work for all possible input values.

Required Components:

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, 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 and the Monthly Rate is in decimal format (for example 1% = 0.01). You can calculate a monthly payment for a loan using:

Monthly Payment = Principal * 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. 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.

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 doAmortization.jsp will be called to create the loan amortization output. doAmortization.jsp: a jsp page that will:

1. Get the data from the request.

2. Create a Loan and an Amortization objects

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.

image text in transcribed

Here are the results for your loan: Loan Principal: $20,000.00 Loan Term: 360 months. Loan Rate: 0.50% (monthly rate) Month Payment Interest Paid Principal Paid Ending Balance $19.91 $20.01 $20.11 $119.91 $100.00 $119.91 $99.90 $119.91 $99.80 $19,980.09 $19,960.08 $19,939.97 $19,919.76 $20.21 $119.91 $99.70 4 $20.31 $20.41 $20.51 $20.62 $20.72 $119.91 $99.60 $119.91 $99.50 $119.91 $99.40 $19,899.45 $19,879.04 $19,858.52 $19,837.90 $19,817.18 $119.91 $99.29 $119.91 $99.19 10 $119.91 $99.09 $20.82 $20.93 $19,796.36 $119.91 $98.98 11 $19,775.43 $119.91 $98.88 $21.03 12 $19,754.40 $119.91 $98.77 $21.14 $19,733.26 $19,712.02 $19,690.67 13 $1 $98.67 $21.24 $119.91 $98.56 $21.35 15 Figure 1: Beginnning of Loan Amortization Table Figure 2 shows the last rows of values in the amortization table. notice that for correct output the table will end with a zero bal last term. Ofcourse, here we are assuming a constant payment every month with no early payments alowed. |$119.91 $7.53 |348 S112.38 $1,393.23 $1,280.28 $1,166.77 $1,052.70 $938.05 $119.91 $6.97 $119.91 $6.40 $119.91 $5.83 352 $112.94 349 $113.51 $114.08 350 351 $119.91 $5.26 $119.91 $4.69 $119.91 $4.11 $114.65 $115.22 $822.83 $707.04 353 $115.80 354 $116.37 355 $119.91 $3.54 $119.91 $2.95 $119.91 $2.37 $590.66 $473.70 $356.16 356 $116.96 357 $117.54 Here are the results for your loan: Loan Principal: $20,000.00 Loan Term: 360 months. Loan Rate: 0.50% (monthly rate) Month Payment Interest Paid Principal Paid Ending Balance $19.91 $20.01 $20.11 $119.91 $100.00 $119.91 $99.90 $119.91 $99.80 $19,980.09 $19,960.08 $19,939.97 $19,919.76 $20.21 $119.91 $99.70 4 $20.31 $20.41 $20.51 $20.62 $20.72 $119.91 $99.60 $119.91 $99.50 $119.91 $99.40 $19,899.45 $19,879.04 $19,858.52 $19,837.90 $19,817.18 $119.91 $99.29 $119.91 $99.19 10 $119.91 $99.09 $20.82 $20.93 $19,796.36 $119.91 $98.98 11 $19,775.43 $119.91 $98.88 $21.03 12 $19,754.40 $119.91 $98.77 $21.14 $19,733.26 $19,712.02 $19,690.67 13 $1 $98.67 $21.24 $119.91 $98.56 $21.35 15 Figure 1: Beginnning of Loan Amortization Table Figure 2 shows the last rows of values in the amortization table. notice that for correct output the table will end with a zero bal last term. Ofcourse, here we are assuming a constant payment every month with no early payments alowed. |$119.91 $7.53 |348 S112.38 $1,393.23 $1,280.28 $1,166.77 $1,052.70 $938.05 $119.91 $6.97 $119.91 $6.40 $119.91 $5.83 352 $112.94 349 $113.51 $114.08 350 351 $119.91 $5.26 $119.91 $4.69 $119.91 $4.11 $114.65 $115.22 $822.83 $707.04 353 $115.80 354 $116.37 355 $119.91 $3.54 $119.91 $2.95 $119.91 $2.37 $590.66 $473.70 $356.16 356 $116.96 357 $117.54

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

2nd Edition

0470624701, 978-0470624708

More Books

Students also viewed these Databases questions

Question

Determine miller indices of plane X z 2/3 90% a/3

Answered: 1 week ago