This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: /* MAE9: Homework #3, Fall 2008 Due on Monday, by 9pm, October 20 (a) Create a table for monthly payments of a house loans. Enter the price of a house from the keyboard, for example price = 450000. For annual interest rates: annual_rate = 0.06 to 0.08 with the increment of 0.002, compute by using the forloop the monthly payments for 15year, 20year, and 30year loans. Print the results in the table on the screen. (b) Copy the previous loop and modify it to calculate the total payments after 15, 20, and 30 years. Print results in another table on the screen. ........................................ Use the formula for equalmonthlypayments: month_pay = price * i* (1 + i)^n/((1 + i)^n  1) where i= annual_rate/12. (monthly interest rate), and n = the total number of payments. The total payment for a given loan is: tot = n * month_pay To compute (1 + i)^n use pow(1.0 + i, (double)n) ..............................................................
View
Full
Document
This note was uploaded on 01/10/2009 for the course MAE MAE 9 taught by Professor Lubarda during the Fall '08 term at UCSD.
 Fall '08
 Lubarda

Click to edit the document details