Question: In JAVA please 6) Implement a class Loan that models a loan on which monthly payments are made. A loan is created with an annual
In JAVA please

6) Implement a class Loan that models a loan on which monthly payments are made. A loan is created with an annual interest rate, given as a decimal value (e.g. 6% per year is given as .06). At any given time the loan has a balance, the amount that is still owed. Each time a payment is made, the interest owed for one month is calculated and added to the balance, and then the amount of the payment is subtracted. (If the balance is negative, no interest is added.) The class should have the following as its public interface: A constructor allowing the interest rate and initial balance to be specified. A method makePayment that correctly adjusts the balance according to the given payment amount. The method has one double parameter, the amount of the payment. A method getBalance that returns the current balance. A method getPayoffAmount that returns the amount that would be required to pay off the balance at the next payment (balance plus one month's interest) Example: A loan is constructed with an initial balance of $1000.00 and an interest rate of 0.24. After calling make Payment (100.0), the new balance is 920.00. (One month's interest is .02 * 1000.00, or 20.00. Note that.02 is one-twelfth of the annual interest rate of 24.) If getPayoffAmount() is now called, it returns 938.40, which is the balance of 920.00 plus 18.40 interest (.02 * 920.00)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
