] > Assignment 4: Loan Calculations (Due: Th, Oct 30)

Assignment 4: Loan Calculations (Due: Th, Oct 30)

Write a program Loan.java that calculates loan information when given a loan amount, the number of monthly payments, and the yearly loan interest. The loan information should include

  1. The monthly payment
  2. The schedule of payments
  3. The number of months to save the amount (instead of taking a loan)

The following are formulas to calculate the monthly payment and the number of months to save the loaned amount.



monthly payment p?
loan amount a
number m of months
yearly interest i %
p = a i 12100 1 1 (1+ i 12100 )m


number m of months to save?
saving amount a
yearly interest i %
monthly payment p
m = lg(1 + a p i 12100) lg(1 + i 12100)


For instance, the following is a possible output for a call of the form ‘java Loan 10000 12 6.5’.

-----------------------  
       Loan  
-----------------------  
Loan amount = 10000.0  
Months = 12  
Yearly interest = 6.5%  
Monthly interest = 0.5417%  
Monthly payment = 862.96  
Total payments = 10355.57  
Payment schedule:  
  Month  Interest  Principal  Balance  
  -----  --------  ---------  -------  
    1      54.17     808.8    9191.2  
    2      49.79     813.18   8378.02  
    3      45.38     817.58   7560.44  
    4      40.95     822.01   6738.43  
    5      36.5      826.46   5911.96  
    6      32.02     830.94   5081.02  
    7      27.52     835.44   4245.58  
    8      23.0      839.97   3405.61  
    9      18.45     844.52   2561.1  
   10      13.87     849.09   1712.01  
   11       9.27     853.69    858.31  
   12       4.65     858.31      0.0  
Months to save amount 10000.0: 11.27

Notes.