PDA

View Full Version : Assistance Request IRT Mortgage Calculator


Gary0422
07-14-2005, 12:27 PM
Hello fellow programmers,

I am in need of assistance. I am building a Javascript-only DOS Mortgage Loan Calulator. I'm having difficulty inserting a "for" loop that will allow the program to continously calculate each month's payment and interest paid for that month until the loan is ressolved (0.00 balance)
Mortgage Amount: 200,000.00
Loan term: 30 years
Interest Rate: 5.75%
Here's what I have so far;
-----------------------------------------------------------------------
import java.awt.*;
import javax.swing.*;
import java.text.NumberFormat;


class MortgageGary {
public static void main(String[] arguments) {
double amount = 200000.00;
double term = 30;
double rate = 5.75;
double monthlyInterestRate = rate / 1200;
double monthlyPayment = amount * (monthlyInterestRate /
(1 - Math.pow((1 + monthlyInterestRate), -(term * 12))));
double remainingAmount;
double monthlyInterest;
// double remainingPayment = remainingAmount * (monthlyInterestRate /
//(1 =2D Math.pow((1 + monthlyInterestRate), = (term * 12))));
NumberFormat usDigits = NumberFormat.getCurrencyInstance();
String payment = usDigits.format(monthlyPayment);
System.out.println ();
System.out.println("The Total Mortgage Amount is $200,0000.00");
System.out.println("The Interest Rate for Duration of Loan is 5.75%");
System.out.println("The Duration of Mortgage is 360 months");
System.out.println("The monthly mortgage payment is " + payment);
System.out.println();
for (double payment; remainingAmount > 0; dex++)
{
int multiple = remainingAmount * (monthlyInterestRate /
(1 - Math.pow((1 + monthlyInterestRate), -(term * 12))));

}
} }

-------------------------------------------------------------------------
Can anyone provide me some insight as to how to insert a "for" loop so that the program can continuously count down each month's payment and interest paid until the mortgage loan is at 0.00 balance?

Any Assistance would be greatly appreciated..:o)

Gary0422

jbot
07-14-2005, 12:29 PM
This is the Javascript forum for posting completed scripts. It's not a Java forum for requesting help. Note, while "Javascript".substring(0,4)=="Java", Java != Javascript.

A mod will move this to the correct location at some point.

Welcome to the forums, all the same :D

Gary0422
07-14-2005, 12:37 PM
hello jbot,

Sorry for posting in wrong area.

Can you speak in Layman's terms please. I'm a beggining programmer.

Do you know how I can fix my program?

Thanx in advance

Gary0422

jbot
07-14-2005, 12:47 PM
No, because I don't do Java. I'm a JavaScript coder which has nothing to do with Java at all, despite the confusing similarity in names.

If you a PM (private message) a Moderator, they'll move it to the correct forum. you'll get an answer there. :thumbsup:

Gary0422
07-14-2005, 12:51 PM
jbot,

Can you lead me in that direction? I'm new at this and this forum. ;)

Thanx in Advance

jbot
07-14-2005, 12:54 PM
at the foot of main page, there's a list of moderators. click on one of them, and you'll go to the profile of said mod. from there, you can send a private message to him/her. just follow the links, man :)