Write a program that creates a loan amortization table. Theuser of the program w
ID: 3616181 • Letter: W
Question
Write a program that creates a loan amortization table. Theuser of the program will supply values for Initial Loan Principal,Annual Percentage Rate and Monthly Payment. The programshould print out the appropriate amortization table including thenumber of Monthly Payments and the Total Interest paid for the lifeof the loan. The program should allow multiple runs (up to 4different versions) of the table process and should allow the userto compare runs in a tabular format.Explanation / Answer
please rate - thanks I think this is what you are looking for import java.util.*; public class amortization {public static void main(String [] args) {double principal, rate, mrate, mpay, factor,interest=0,totint=0,mint; int month=0, cnt=1,runs=0; char again='y'; String input; Scanner in=new Scanner(System.in); do{cnt=1; System.out.print("Enter the principal of the loan:"); principal=in.nextDouble(); System.out.print("What is the monthly payment?"); mpay=in.nextDouble(); System.out.print("What is the Annual Interest Rate?"); rate=in.nextDouble(); System.out.printf("Principal: $%.2f ",principal); System.out.printf("Annual Interest Rate:%.2f%% ",rate); System.out.printf("Monthly Payment:%.2f ",mpay); System.out.printf("Payment Interest Principal Balance "); while(principal>mpay) {interest=principal*((rate/100)/12); totint+=interest; System.out.printf("%3d %7.2f %7.2f",cnt,interest,principal); principal=principal+interest-mpay; System.out.printf(" %7.2f ",principal); cnt++; } interest=principal*((rate/100)/12); totint+=interest; System.out.printf("Final Payment:$%6.2f ",principal+interest); System.out.printf("Total interest paid$%6.2f ",totint); System.out.println("Total number of payments:"+(cnt)); runs++; if(runsRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.