7 year at 5.35%
15 year at 5.5%
30 year at 5.75%
Use an array for the different loans. Display the mortgage payment amount for each loan and 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.
This is my starting point and I now trying to get this program do execute these things as well and am totally lost has I have not programming experiance. Please someone help me?
/*
Week 5 IA: Mortgage Payment Calculator
Programmer: M. Loper
Date: July 17, 2006
Filename: WK5IA.java
Purpose: Calculate Mortgage Payments
*/
import java.io.*;
import java.text.*;
public class WK5IA
{
public static void main(String[] args)throws IOException
{
DecimalFormat twoplaces = new DecimalFormat("#,###.00");
InputStreamReader reader = new InputStreamReader(System.in);
BufferedReader object = new BufferedReader(reader);
double loan = 200000.00; //Array
int[] length = new int[3];
length[0]=7;
length[1]=15;
length[2]=30;
double [] interest = new double [3];
interest[0] = .0535;
interest[1] = .0550;
interest[2] = .0575;
int x = 0;
do //Do Statement
{
double payment = (loan*(interest[x]/12))/(1-(Math.pow(1/(1+(interest[x]/12)),(length[x]*12)))); //Display Math
System.out.println("\n\nYour Mortgage Payment " + twoplaces.format(payment) + "\n\nfor the " + length[x] + " Year Contract "); //Display Text to explane values
x++;
}
while (x <3);
}
}

New Topic/Question
Reply




MultiQuote




|