Explore BrainMass
Share

# Mortgage Calculator Modification

This content was STOLEN from BrainMass.com - View the original, and get the already-completed solution here!

Modify the mortgage program to display 3 mortgage loans: 7 year at 5.35%, 15 year at 5.5 %, and 30 year at 5.75%. Use an array for the different loans. Display the mortgage payment amount for each loan. Then, list the loan balance and interest paid for each payment over the term of the loan. Use loops to prevent lists from scrolling off the screen. Do not use a graphical user interface. Insert comments in the program to document the program.

Please use the following to build upon

import java.io.*;
import java.util.Date;
import java.text.DecimalFormat;

public class Mortgage4
{
public static void main(String[] args)
{
Date currentDate = new Date(); //Date constructor
DecimalFormat decimalPlaces=new DecimalFormat("0.00");

//declaring variables
final double PRINCIPLE = 200000;
final double INTEREST = .0575;
final double TERM = 12*30;
final double MonthlyInterest = INTEREST/12;

//declaring variables
final double MONTHLY = (PRINCIPLE/ ((Math.pow((1 + MonthlyInterest), TERM) -1) / (MonthlyInterest * Math.pow((1 + MonthlyInterest), TERM))));
//displaying variables
System.out.println("tt" + currentDate);
System.out.println("ttPrinciple or Loan Amount: " + PRINCIPLE);
System.out.println("ttInterest Rate: " + INTEREST);
System.out.println("ttThe Term of Loan (in months): " + TERM);
System.out.println("ttThe Monthly Payment is: \$" + decimalPlaces.format(MONTHLY));
//System.out.println(decimalPlaces.format(MONTHLY));
}
}

https://brainmass.com/computer-science/user-interface/168900

#### Solution Preview

Hi,

Thanks
Baseraj Mathew K

UPDATING:

Dear friend,

I have done the ...

#### Solution Summary

This solution provides a program that acts as a mortgage calculator.

\$2.19