Indy717
asked on
Need helping figuring out the error message I am getting on my Java Mortgage Calculator program.
//Filename MortgageCalWk3_code
//Written by Jennifer Pike
//SR description: Write a program in Java (without GUI) using a loan amount of $200,000 wityh an interest rate of 5.75% over a 30 year term.
//Display the mortgage payment and then list the loan balance and interest paid for each payment over the term of the loan.
//If the list would scroll off the screen, use loops to display a partial list, hesitate, and then display more of the list.
import java.text.*;
import java.util.*;
public class mortgagePayment_wk3
{
public static void main(String[] args)
{
//declaration statements
int length=30; // 30 year mortgage
double Principal=200000.00; //Loan Amount
double InterestRate=5.75;
double monthly_payment = 0.00;
double monthly_principal= 0.00;
double monthly_interest = 0.00;
NumberFormat currency= NumberFormat.getCurrencyIn stance
double y_rate = (rate /100/12);
double monthly_payment = balance * ( y_InterestRate / (1 - Math.pow((1+y_InterestRate ),-1*(leng th*12) ) ));
y_InterestRate = (InterestRate/100)/12;
System.out.println("\t\tMo rtgage Payment Formula");
System.out.println("\t\tBa lance own is $200,000");
System.out.println("\t\tYe arly interest rate is 5.75%");
System.out.println("\t\tTh e length of loan is 30 years\n");
// start of loop to calculate interest paid and balance owe
// print statement as balance increment,as interest increment
for (int mpi =1; mpi<=length*12; mpi++) { // months of payment being decrimented start counter
monthly_interest = (balance*y_InterestRate);
balance = (balance - monthly_Principal);
monthly_principal = (monthly_payment - monthly_interest);
System.out.println("Balanc e is $" + currency.format(balance));
System.out.println("Intere st paid is $" + currency.format(monthly_in terest));
try {Thread.sleep(10);} catch (InterruptedException e){}
}
}
}
1 error found:
File: C:\Mortgage\mortgagePaymen t_wk3.java [line: 20]
Error: C:\Mortgage\mortgagePaymen t_wk3.java :20: ';' expected
//Written by Jennifer Pike
//SR description: Write a program in Java (without GUI) using a loan amount of $200,000 wityh an interest rate of 5.75% over a 30 year term.
//Display the mortgage payment and then list the loan balance and interest paid for each payment over the term of the loan.
//If the list would scroll off the screen, use loops to display a partial list, hesitate, and then display more of the list.
import java.text.*;
import java.util.*;
public class mortgagePayment_wk3
{
public static void main(String[] args)
{
//declaration statements
int length=30; // 30 year mortgage
double Principal=200000.00; //Loan Amount
double InterestRate=5.75;
double monthly_payment = 0.00;
double monthly_principal= 0.00;
double monthly_interest = 0.00;
NumberFormat currency= NumberFormat.getCurrencyIn
double y_rate = (rate /100/12);
double monthly_payment = balance * ( y_InterestRate / (1 - Math.pow((1+y_InterestRate
y_InterestRate = (InterestRate/100)/12;
System.out.println("\t\tMo
System.out.println("\t\tBa
System.out.println("\t\tYe
System.out.println("\t\tTh
// start of loop to calculate interest paid and balance owe
// print statement as balance increment,as interest increment
for (int mpi =1; mpi<=length*12; mpi++) { // months of payment being decrimented start counter
monthly_interest = (balance*y_InterestRate);
balance = (balance - monthly_Principal);
monthly_principal = (monthly_payment - monthly_interest);
System.out.println("Balanc
System.out.println("Intere
try {Thread.sleep(10);} catch (InterruptedException e){}
}
}
}
1 error found:
File: C:\Mortgage\mortgagePaymen
Error: C:\Mortgage\mortgagePaymen
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.