
I'm going crazy trying to build a loop to display the list of loan balance and interest of each payment over the loan term (30 yrs).
Here is the code, Please somebody help!!! I need to post tomorrow, it will be perfect if I can check it out after non, I have to finish the flowchart for it.. Any help is greatly appreciated...
/*Purpose: Change Request #1- Display mortgage payment amount and then list loan balance and interest paid for each payment over the loan term.
Date: February 17, 2007
Version 1.0
*/
import java.Math.*;
import java.text.*;
import java.text.DecimalFormat;
public class MortgageLoanBal
{
// The "throws Exception" statement at the end allows the program to continue
// to run when encounters an error
public static void main(String[] args)throws Exception
{
// I would use the number formatter Alex Cook recommended too
java.text.NumberFormat money = java.text.NumberFormat.getCurrencyInstance();
/* Defining Variables */
double mlprincipal = 200000.00;
double mlinterestrate = 5.75;
int mlyears = 30;
//Process Monthly Payment
double mlPayment = mlMortgageLoanBal.getMortgageLoanBal(mlprincipal,, mlinterestrate/12, mlyears*12);
int LineCount = 1;
double monthlyinterest = 0;
double monthlyinterest = annualinterest/12;
// Display Beginning Balance
System.out.println("Beginning Balance = " + money.format(mlprincipal));
while (LoanBalance > 0.01)
{
//Process & Display New Loan Balances
mlmonthlyinterest = mlprincipal*mlmonthlyinterest;
mlprincipal = mlprincipal+mlmonthlyinterest-mlpayment;
system.out.println(money.format(mlprincipal));
//Display Message to Continue on Next Page
if (LineCount > 12)
{
System.out.println("Press Enter to View Next Page");
}
else
{
LineCount = LineCount+1;
}
}