The previous answer fixed the 4 errors now it is not giving me the information, what is the problem?
The answer before fixed the errors, now this is what it gives me, not all of the information is there, what did I do wrong?
/*
* Week 5 Assignment
* Write the program in Java (without graphical user interface) and have it calculate
* the payment amount with 3 mortgage loans: 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 lis from scrolling off the screen.
*
*
*/
package mcbridemortgagecalculator2;
/**
*
*
*/
import java.lang.Math;
import java.text.DecimalFormat;
class McBridemortgagecalculator2
{
public static void main(String[]args){
//Declare variables
int loanAmt = 200000;//Principal loan amount
int [] loanTerm = {84, 180, 360};//Loan term for 7 years, 15 years, and 30 years
double[] intRate = {5.35, 5.50, 5.75};//Interest rares for 7 years, 15 years, and 30 years
int monthNum = 85;
int montNum2 = 181;
int monthNum3 = 361;
int loanNum = 0;
int line = 0;
double monthlyPay = 0;//Display monthly payment calculation
double newLoanBal = 200000;//Loan balance
double monIntPaid = 0;//Interest paid
double newIntRate = 0;//Monthly interest rate
double monPrinPay;//Monthly principal payment
DecimalFormat money = new DecimalFormat(“$0.00″);//Display mortgage amount in decimal
DecimalFormat interest = new DecimalFormat(“0.00%”);//Display inteest rate amount in decimal
//Display message in the console window
System.out.println();
System.out.println(“McBride Mortgage Calculator 2″);
System.out.println();
System.out.println(“This program will calculate three separare mortgage payments for a $”);
System.out.println(“with the following loan terms and interest rates”);
System.out.println(“7 years @5.35%”);
System.out.println(“15 years @5.50%”);
System.out.println(“30 years @5.75%”);
System.out.println();
System.out.println(“Following the math calculation of the payments, the program display the”);
System.out.println(“mortgage payments, interest paid, and loan balance for the terms of the”);
System.out.println(“three different loans”);
System.out.println();
System.out.println(“The loan results are as follows”);
int i;
for (i = 0; i<= 2; i++)
{
int j;
for (j = 0; j<=2; j++)
{
//Performs calculation for loan term, interest rate, and monthly payment
loanTerm[i]= loanTerm[i];
intRate[i] = (intRate[i] * .01)/12;
monthlyPay = loanAmt*intRate[i]/(1- Math.pow(1+ intRate[i],-loanTerm[i]));
//////////////pow(double,double)////////////
if (loanNum <= 2)
{
loanNum++;
//Display results for each loan in the console window
System.out.println();
System.out.println(“Loan” + loanNum);
System.out.println(“********************”);
System.out.println();
System.out.println(“The monthly mortgage payment for a $” + loanAmt + “over a” + loanTerm);
System.out.println(“interest rate =” + (money.format(monthlyPay)));
System.out.println();
System.out.println(“The mortgage payment, interest paid, and loan balance for the loan is as”);
System.out.println(“follows”);
System.out.println();
}
//Begins loop
while (newLoanBal >0);
{
newLoanBal = 200000;
if (i >= 0)
monIntPaid = intRate[i] * newLoanBal;
monPrinPay = monthlyPay – monIntPaid;
newLoanBal = newLoanBal – monthlyPay + monIntPaid;
//Display result of calculations for monthly principal paid, and new loan balance
System.out.println((money.format(monthlyPay)) + “t” +(money.format(monIntPaid)));
//Decrements monthly count one month at a time until count reaches zero
monthNum–;
//Pause console window, then continue calculations
if (line == 20)
{
line = 0;
try
{
Thread.sleep (2000);
}
catch (InterruptedException e){}
{
}
}
}
}
}
}
}
public class Main {
/**
* @param args the command line arguments
*/
// TODO code application logic here
}
run:
McBride Mortgage Calculator 2
This program will calc
run:
McBride Mortgage Calculator 2
This program will calculate three separare mortgage payments for a $200000
with the following loan terms and interest rates
7 years @5.35%
15 years @5.50%
30 years @5.75%
Following the math calculation of the payments, the program display the
mortgage payments, interest paid, and loan balance for the terms of the
three different loans
The loan results are as follows
Loan1
********************
The monthly mortgage payment for a $200000over a7-yearperiod at a 5.35%
interest rate =$2859.79
The mortgage payment, interest paid, and loan balance for the loan is as
follows
Loan2
********************
The monthly mortgage payment for a $200000over a15-yearperiod at a 5.50%
interest rate =$1634.17
The mortgage payment, interest paid, and loan balance for the loan is as
follows
Loan3
********************
The monthly mortgage payment for a $200000over a30-yearperiod at a 5.75%
interest rate =$1167.15
The
This is with semicolon
The loan results are as follows
Loan1
********************
The monthly mortgage payment for a $200000over a7-yearperiod at a 5.35%
interest rate =$2859.79
The mortgage payment, interest paid, and loan balance for the loan is as
follows
$2859.79 $891.67 $198031.88 Payment(s) complete
Loan2
********************
The monthly mortgage payment for a $200000over a15-yearperiod at a 5.50%
interest rate =$1634.17
The mortgage payment, interest paid, and loan balance for the loan is as
follows
$1634.17 $916.67 $199282.50 Payment(s) complete
Loan3
********************
The monthly mortgage payment for a $200000over a30-yearperiod at a 5.75%
interest rate =$1167.15
The mortgage payment, interest paid, and loan balance for the loan is as
follows
$1167.15 $958.33 $199791.19 Payment(s) complete
BUILD SUCCESSFUL (total time: 0 seconds)
The first is without semicolons, it should show for all 3, loan bal, int paid, mortg pay of the term of loan.
I hope this help. I have added and taken away