HW3 - MAE9 Homework#3 Fall 2006 Due on Thursday October 12...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
/* MAE9: Homework #3, Fall 2006 Due on Thursday, October 12, before 9:00 pm Create a table for monthly payments of auto loans. Enter the price of a car from the keyboard as an integer, for example price = 50000. For annual interest rates: annual_rate = 0.080 to 0.100 with the increment of 0.0025, compute by using a for-loop the monthly payments for 3-year, 5-year, and 7-year loans. Print the results in a table on the screen using %12.4f for the annual interest rates and %15.2f for the payments. Use the formula for equal-monthly-payments: month_pay = price * i* (1 + i)^n/((1 + i)^n - 1) (2.4) where i= annual_rate/12. (monthly interest rate), and n = the total number of payments. To compute (1 + i)^n use pow(1.0 + i, (double)n) Note: You need #include <math.h> in your hw3.c and the -lm option when you compile: gcc hw3.c -lm. ------------------------------------------------------- Your output should look like this: Enter the price (int): $50000 price = $50000 Monthly Payments Ann. Int. Rates
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/22/2008 for the course MAE 9 taught by Professor Lubarda during the Fall '07 term at UCSD.

Page1 / 2

HW3 - MAE9 Homework#3 Fall 2006 Due on Thursday October 12...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online