// Loan Calculator import java.util.Scanner; public class Program3 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.println(" == LOAN CALCULATOR PROGRAM =="); System.out.print("Please enter loan amount: "); double loanAmount= scan.nextDouble(); System.out.print("Please enter number of years: "); int numberOfYears = scan.nextInt(); System.out.print("Please enter APR: "); double APR = scan.nextDouble(); // calculate the monthly interest rate from the APR double monthlyInterestRate = (APR/100.0)/12.0; // compute the monthly payment double numerator = loanAmount*monthlyInterestRate; double denumerator = 1 - 1/( Math.pow(1 +monthlyInterestRate, numberOfYears*12)); double monthlyPayment = numerator / denumerator; double totalPayment = monthlyPayment * numberOfYears * 12; System.out.println("The monthly payment is: " + monthlyPayment); System.out.println("The total payment is: " + totalPayment); } }