Untitled
By: a guest | Mar 18th, 2010 | Syntax:
Java | Size: 0.45 KB | Hits: 38 | Expires: Never
public class Mortgage {
public static void main(String[] args) {
double myBalance = 200000;
double myRate = .0575;
double myTerm = 30;
double myInterest = 0;
double myPayment = 0;
myInterest = myRate / (12 * 100);
myPayment = myBalance * (myInterest / (1 - (1 + myInterest) * -12 * myTerm));
System.out.format("Monthly payment is $%.2f%n", myPayment);
System.out.format("Term of payment is %.0f years. %n", myTerm);
}
}