Question: use basic language constructs including declaring variables, expression, input using Scanner, output using System.out.printf, decision making, looping constructs and methods. you can use this as

n = numberOfYear * 12;
monthlyPayment = (loanAmount * i * Math.pow(i + 1, n)) / (Math.pow(i + 1, n) - 1);
totalPayment = monthlyPayment * 12;
For the formula to compute monthly payment, see Listing 2.9, ComputeLoanj.jarz (Financial application: loan amortization schedule) The monthly payment fors given loan pays the principal and the interest. The monthly interest is compuled by multiplying the monthly interest rate and the balance (the remaining princt pal). The principal paid for the month is therefore the monthly payment minks the monthly interest. Write a program that lets the user enter the loan amourh number of years, and interest rate and displays the amortization schedule for the loan. Here is a sample run: Note The balance after the last payment may not be zero. If so. the last payment should be the normal monthly payment plus the final balance. Hint: Write a loop to display the table. Since the monthly payment is the same for each month, it should be computed before the loop. The balance is initially the loan amount. For each iteration in the loop, compute the interest and principal, and update the balance. The loop may look like this
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
