Question: IN JAVA PLEASE! Write a program to help a person keep track of payments made on a no-interest loan with a specific monthly payment amount.
IN JAVA PLEASE! Write a program to help a person keep track of payments made on a no-interest loan with a specific monthly payment amount.
Read from the user: - the original loan amount - the monthly payment
(1-2) Then write a while loop to display the payment and balance each month, until the loan is paid back.
Sample run:
Enter loan amount: 500 Enter monthly payment: 100 Monthly results: Paid 100.00 -> balance 400.00 Paid 100.00 -> balance 300.00 Paid 100.00 -> balance 200.00 Paid 100.00 -> balance 100.00 Paid 100.00 -> balance 0.00
(3-5) Modify the code in the loop, so that when the payment is more than the balance, only the remaining balance will be paid (to prevent the balance from going below zero).
Sample run:
Enter loan amount: 600 Enter monthly payment: 125 Monthly results: Paid 125.00 -> balance 475.00 Paid 125.00 -> balance 350.00 Paid 125.00 -> balance 225.00 Paid 125.00 -> balance 100.00 Paid 100.00 -> balance 0.00
import java.util.Scanner;
/**
*
* @author
*/
public class LoanBalances {
public static void main(String[] args) {
Scanner kb = new Scanner(System.in);
// Enter solution here
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
