Servlet Assignment Credit Card Payment Schedule with Servlet as View/Controller Objective: Create a simple program that will print a schedule of payments to pay off a credit card balance over time....


Servlet Assignment




Credit Card Payment Schedule with Servlet as View/Controller


Objective:



  • Create a simple program that will print a schedule of payments to pay off a credit card balance over time.


Scenario/Information:


If you carry a balance on a credit card, it can be nice to see how long it would take to payoff the card. For this scenario, you should design a Java Web application the displays a credit card payment schedule.


Inputs for your program should include: Customer’s name (first and last), the account number (as an integer), the current balance (as double) and the percent of the balance that will paid off each month (i.e. 5% as double). Your program should use a form on the index.jsp page to allow the user to enter the input from the browser.


After receiving the input, return a report to the client that displays a table of payments. Sample output is shown below.


Assume the following:



  • At the beginning of every month 1.5% interest is added to the balance.

  • The customer payment will be calculated using the monthly balance (including the interest) and the Percent to Pay input.

  • The ending balance can be calculated using: beginning balance + interest - payment.

  • Assume that when the monthly ending balance is less than the initial monthly payment, the customer can afford to pay off the remainder (plus interest) in the next month.

  • You can use the Java NumberFormat class to make values appear as currency when printed.


Required Components:


You should make the following components for this assignment:


index.jsp:an html form page that allows the user to enter the input data. Use textboxes and buttons. When the form is submitted, the Servlet class will be called to create the output.


CreditCard.java:This defines a credit card object. This component represents a credit card account. Fields are included that represent the input data. In addition to Constructors and getters/setters, this component includes a method that will create a String. The String should contain the html and content of the output table.


CardServlet:A servlet that will:



  1. Get the data from the request.

  2. Create a CreditCard object

  3. Use the CreditCard object to calculate the payment schedule table

  4. Get table String and values from CreditCard object and incorporate it into the HTML for response to the client.

Sep 15, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here