<%@ page import= "java.text.NumberFormat" %> <%@ page import= "java.util.Locale" %> <%@ page errorPage="../mainerror.jsp"%>

Mortgage Calculator

Enter House Price
<%= price %> > What you expect to pay for the home
Enter Amount of Down Payment You Have
<%= down %> >
use percent
<%= value %> <% } } %> >
If you have equity in your current home that would apply here
Enter an Interest Rate
<%= rate %> > Choose a current rate such as 6.75
Select a Loan Term
<% String term = request.getParameter("term"); if ( term == null) term = "30"; %> 30 Years is the Default
     
<% price = request.getParameter("price"); down = request.getParameter("down"); rate = request.getParameter("rate"); term = request.getParameter("term"); %> <% if ( price == null || down ==null || rate == null || price.compareTo("") == 0 || down.compareTo("") == 0 || rate.compareTo("") == 0) { String msg = "Please enter a value for each entry"; %> <%= msg %> <% } else { int house = 0; Locale currentLocale; currentLocale = new Locale("en", "us"); NumberFormat currencyFormatter; currencyFormatter = NumberFormat.getCurrencyInstance(currentLocale); house = mortgageBeanId.calculatePayment(price,down,rate,term); String currencyOut = currencyFormatter.format(house); if ( house < 0 ) currencyOut = "Invalid Input Data. Please Re-Enter Values"; %> <%= currencyOut %> <% } %>   This is the monthly payments of Principal & Interest