Classwork/Homework:
-
- Write a java program CarLoan_YI.java to print a table giving the total amount paid and the remaining principal after each monthly payment.
- Prompt the user for the amount, interest and number of years.
- The prompt should include relevant messages so the user understands the input format.
- One of your runs should be with the data given below.
NOTE: your program properly handles an interest rate of 0% and avoids dividing by 0.
Click on the image to understand the formula
Example output:
Amount borrowed = 1000.00
Number of years = 2Interest rate = 3.00
Monthly payments = 42.98
Total interest = 31.55
If the total interest is pre-paid here is a chart:Month Amt Paid Remaining 1 42.98 957.02 2 85.96 914.04 3 128.94 871.06 4 171.92 828.08 5 214.91 785.09 6 257.89 742.11 7 300.87 699.13 8 343.85 656.15 9 386.83 613.17 10 429.81 570.19 11 472.79 527.21 12 515.77 484.23 13 558.76 441.24 14 601.74 398.26 15 644.72 355.28 16 687.70 312.30 17 730.68 269.32 18 773.66 226.34 19 816.64 183.36 20 859.62 140.38 21 902.61 97.39 22 945.59 54.41 23 988.57 11.43
If the total interest if included in the monthly payments, here is a chart:
Courtesy from Diane Li
/** Input/Output: Enter the loan amount in dollars: 1000 Enter the loan term in years: 2 Enter the annual interest rate as a percentage: 3 Month Amount Paid Remaining 1 42.98 988.56 2 85.96 945.58 3 128.94 902.60 4 171.92 859.62 5 214.90 816.64 6 257.88 773.66 7 300.86 730.68 8 343.84 687.69 9 386.83 644.71 10 429.81 601.73 11 472.79 558.75 12 515.77 515.77 13 558.75 472.79 14 601.73 429.81 15 644.71 386.83 16 687.69 343.84 17 730.68 300.86 18 773.66 257.88 19 816.64 214.90 20 859.62 171.92 21 902.60 128.94 22 945.58 85.96 23 988.56 42.98 24 1031.54 0.00 **/
Even though this chart doesn’t reflect the finance charge, it is an effective way to show the amount paid and the remaining values. In some cases, the finance charge is paid up front.
Optional
Car Loans | How Does Car Loan Interest Work? | IFS How does car loan interest affect you? Most car loans use simple interest. Learn more about car loan interest – it could save you money. Source: www.ifsautoloans.com/car-loan-interest/ If you really want the challenge of using the amortization model here is a chart that can show the effect of how the interest charges decrease as the amount borrowed also decreases.
- Write a java program CarLoan_YI.java to print a table giving the total amount paid and the remaining principal after each monthly payment.