Question
Asked by:
akhan143
akhan143 from Brookheaven
Rating : No Rating
Questions Asked: 3
Tutorials Posted: 0
 

$5.00 Mortgage monthly payment

Q:
The monthly payment on mortgage loan of L dollars, at a rate of interest r is given
by Monthly payment = [L(r/12)(1+R/12) ]/[(1+2/12) - 1]

Where N is the number of years of mortgage. Write a program to find the monthly
payment for 30 years, for principals from $100,000 through $200,000(with increments
of $20,000) and interest rates of 6% through 10% (with increments of 0.5%). Print
monthly payment as a whole number (rounded off).


The output must be a neat table, similar to the following (your answers may be slightly
different because of rounding off).
Principal 6% 6.5% 7% 7.5% 8% 8.5% 9% 9.5% 10%
100000 600 632 665 699 733 768 804 840 877
120000 719 758 798 839 880 922 965 1009 1053
140000 … … … … … … … … …
160000 … … … … … … … … …
180000 … … … … … … … … …
200000 … … … … … … … … …
Hint: Use the following idea to compute
double temp = 1+r/12;
double temp1 = 1;
for (int i = 1; i<=12*N;i++)
{
temp1 = temp1*temp;
}
The final formula now becomes:
double mp = (L*(r/12)*temp1)/(temp1-1);
 
bricefabber asked: You didn't specify what language you want this in. I'm assuming C++?
To which akhan143 said: Java.
Want to take a stab at the bounty and post a tutorial? Need clarification? Join us now or log in! Read more on how this works.
 
Available Tutorials to this Question
Posted by:
b_h
b_h from U. in B.
Rating (488): A+
Questions Asked: 0
Tutorials Posted: 912, earned $16,356.96
 

$10.00 Mortgage Payment table in Java

  • This tutorial was purchased 2 times and rated A+ by students like you.
  • Posted on Oct 14, 2008 at 9:03:28PM
A:
Preview: ... t rate.

For each element in the table, the monthly payment is computed, rounded and printed.

The code uses the Java printf function to make sure that enough space is given to each payment amount so the numbers in ...

The full tutorial is about 320 words long plus attachments.

Attachments:
MortgagePrint.java (1K) (Preview)
   
Join Now or Log In
Get Tutoring
Get Paid
Academic Honesty