Car Payment
View as PDF
Submit solution
Points:
3
Time limit:
2.0s
Memory limit:
64M
Author:
Problem type
Allowed languages
Java
is trying to pay off his new car, a Toyota Corolla 2011. Write him a program that determines how much money he needs to pay each month to finish paying off his car in months if the principal amount he owes is
and the rate of interest is
. The monthly payment is calculated using the following formula:
Input
The first line of input is
.
The next line is
.
The next line is
.
Output
Rounded to 2 decimals and using double precision floating point math, including trailing zeroes, print the monthly payment should pay in order to pay off his car in months.
Note: Do not use DecimalFormat for this question. Use System.out.printf(). Refer to this documentation)
Sample Input
20000
0.07
48
Sample Output
478.92
Comments