You have just
graduated from college with a degree in Computer Science
and youíve landed a GREAT job as a developer at
Hewlett-Packard. Only problem is, you donít have a car
to get back and forth from work.
Write a program
to determine your monthly car payment. The formula
for determining the monthly payment of a loan is:
P = L[c(1
+ c)n]/[(1 + c)n - 1]
= monthly payment
= loan amount in dollars
= number of months for the loan
= the monthly interest rate (for example, if the yearly
interest is 6%, c is 0.06/12 or 0.005)
should prompt for the cost of the car (an integer
value), down payment (an integer value), yearly interest
rate (a decimal value), and number of months for the
loan (an integer value).
You can assume
that none of the integer values entered will be 0 (maybe
you can convince the Bank of Mom and Dad to give you one
of those special 0% interest loans).
Enter the cost of
the car: 25000
Enter the down
Enter the yearly
interest rate: 5.9
Enter the number
of month for the loan: 48
monthly payment for the loan to the screen.
Your monthly car
payment is: $xxx.xx