Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

NeedAssistance

Modify the mortgage program to display the mortgage payment amount. Then, list the loan balance and interest paid for each payment over the term of the loan. The list would scroll off the screen, but use loops to display a partial list, hesitate, and then display more of the list. Do not use a graphical user interface. Insert comments in the program to document the program.

Currently I am working on adding the following line in bold but getting error expected ";" on line 27

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

public class Mortgage5
{
public static void main(String[] args)
{
Date currentDate = new Date(); //Date constructor

DecimalFormat decimalPlaces = new DecimalFormat("$###,###.##");

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

//declaring variables
final double MONTHLY =PRINCIPLE*(INTEREST/(1-Math.pow(1+INTEREST, -TERM)));

//displaying variables
System.out.println("\t\t" + currentDate);
System.out.println("\t\tPrinciple or Loan Amount: " + decimalPlaces.format(PRINCIPLE));
System.out.println("\t\tInterest Rate: " + (INTEREST));
System.out.println("\t\tThe Term of Loan (in months): " + (TERM));
System.out.println("\t\tThe Monthly Payment is: " + decimalPlaces.format(MONTHLY));
System.out.println("\t\tThe Balence - Your Payment is: " + decimalPlaces.format(PRINCIPLE*INTEREST*TERM)-MONTHLY));
}
}

Any suggestions? PLEASE
[1594 byte] By [oakc] at [2007-11-11 7:39:38]
# 1 Re: NeedAssistance
You're missing a parenthesis. Change:

System.out.println("\t\tThe Balence - Your Payment is: " +
decimalPlaces.format(PRINCIPLE*INTEREST*TERM)-MONTHLY));

to:

System.out.println("\t\tThe Balance - Your Payment is: " +
decimalPlaces.format((PRINCIPLE * INTEREST * TERM) - MONTHLY));
destin at 2007-11-11 22:37:43 >