Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java Amortization Table: I am trying to write Java code that prints out a monthly breakdown of interest, payment amount, and remaining balance. Inputs received
Java Amortization Table:
I am trying to write Java code that prints out a monthly breakdown of interest, payment amount, and remaining balance. Inputs received from the user include percent to pay and initial balance. I have written a while loop, but it keep outputting as an infinite loop and I'm not sure what I'm doing wrong.
int month1; double interestAmt 0.015 double calc 0; double pmt -0; //HEADER System.out.println("First Name: "firstName); System.out.println("Last Name: "lastName); System.out.print1n("Account #: " + accountNum); System.out.println("Balance Due: "currentBalance); System.out.println("Percent to Pay:"percentToPay); System.out.println"); System.out.println("Credit Payment Schedule); System.out.printlnC" Customer: "firstName"lastName); System.out.print1n("Account #. " + accountNum); System.out.println("Balance Due: " currentBalance); System.out.println(""; System.out.println("" System.out.println("Month Interest Payment Balance"); while (currentBalance> 0) 1 calc-interestAmt*currentBalance; pmt-(calc currentBalance)/percentToPay; current Balance -(currentBalance calc) - pmt; if (calc pmtcurrentBalance) I break; " Cpmt)" System. out.println("month " month++ ""$" +(calc)+ " $" (currentBalance))Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started